Merge pull request #1193 from netpok/skip_generate_in_phpunit

Skip post_migrate when running tests
This commit is contained in:
Markus Podar
2021-03-23 17:47:25 +01:00
committed by GitHub
3 changed files with 2 additions and 7 deletions
+1
View File
@@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
[Next release](https://github.com/barryvdh/laravel-ide-helper/compare/v2.9.2...master)
--------------
### Fixed
- Running tests triggering post_migrate hooks [\#1193 / netpok](https://github.com/barryvdh/laravel-ide-helper/pull/1193)
- Array_merge error when config is cached prior to package install [\#1184 / netpok](https://github.com/barryvdh/laravel-ide-helper/pull/1184)
2021-03-15, 2.9.1
-5
View File
@@ -17,9 +17,4 @@
<code>\Storage</code>
</UndefinedClass>
</file>
<file src="src/IdeHelperServiceProvider.php">
<TooFewArguments occurrences="1">
<code>new PhpEngine()</code>
</TooFewArguments>
</file>
</files>
+1 -2
View File
@@ -19,7 +19,6 @@ use Barryvdh\LaravelIdeHelper\Listeners\GenerateModelHelper;
use Illuminate\Console\Events\CommandFinished;
use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Database\Events\MigrationsEnded;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;
use Illuminate\View\Engines\EngineResolver;
use Illuminate\View\Engines\PhpEngine;
@@ -35,7 +34,7 @@ class IdeHelperServiceProvider extends ServiceProvider implements DeferrableProv
*/
public function boot()
{
if ($this->app['config']->get('ide-helper.post_migrate', [])) {
if (!$this->app->runningUnitTests() && $this->app['config']->get('ide-helper.post_migrate', [])) {
$this->app['events']->listen(CommandFinished::class, GenerateModelHelper::class);
$this->app['events']->listen(MigrationsEnded::class, function () {
GenerateModelHelper::$shouldRun = true;