Skip to content

Commit b8d5fc3

Browse files
authored
Merge pull request #1193 from netpok/skip_generate_in_phpunit
Skip post_migrate when running tests
2 parents 0cae143 + df994eb commit b8d5fc3

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
55
[Next release](https://github.com/barryvdh/laravel-ide-helper/compare/v2.9.2...master)
66
--------------
77
### Fixed
8+
- Running tests triggering post_migrate hooks [\#1193 / netpok](https://github.com/barryvdh/laravel-ide-helper/pull/1193)
89
- Array_merge error when config is cached prior to package install [\#1184 / netpok](https://github.com/barryvdh/laravel-ide-helper/pull/1184)
910

1011
2021-03-15, 2.9.1

psalm-baseline.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,4 @@
1717
<code>\Storage</code>
1818
</UndefinedClass>
1919
</file>
20-
<file src="src/IdeHelperServiceProvider.php">
21-
<TooFewArguments occurrences="1">
22-
<code>new PhpEngine()</code>
23-
</TooFewArguments>
24-
</file>
2520
</files>

src/IdeHelperServiceProvider.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use Illuminate\Console\Events\CommandFinished;
2020
use Illuminate\Contracts\Support\DeferrableProvider;
2121
use Illuminate\Database\Events\MigrationsEnded;
22-
use Illuminate\Foundation\Application;
2322
use Illuminate\Support\ServiceProvider;
2423
use Illuminate\View\Engines\EngineResolver;
2524
use Illuminate\View\Engines\PhpEngine;
@@ -35,7 +34,7 @@ class IdeHelperServiceProvider extends ServiceProvider implements DeferrableProv
3534
*/
3635
public function boot()
3736
{
38-
if ($this->app['config']->get('ide-helper.post_migrate', [])) {
37+
if (!$this->app->runningUnitTests() && $this->app['config']->get('ide-helper.post_migrate', [])) {
3938
$this->app['events']->listen(CommandFinished::class, GenerateModelHelper::class);
4039
$this->app['events']->listen(MigrationsEnded::class, function () {
4140
GenerateModelHelper::$shouldRun = true;

0 commit comments

Comments
 (0)