|
8 | 8 | use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\AbstractModelsCommand; |
9 | 9 | use Closure; |
10 | 10 | use Illuminate\Database\Eloquent\Factories\Factory; |
11 | | -use Illuminate\Foundation\Application; |
12 | 11 | use Illuminate\Support\Str; |
13 | 12 |
|
14 | 13 | class Test extends AbstractModelsCommand |
15 | 14 | { |
16 | | - public function test_8(): void |
| 15 | + public function testFactory(): void |
17 | 16 | { |
18 | | - if (!version_compare(Application::VERSION, '8.2', '>=') || !version_compare(Application::VERSION, '9', '<')) { |
19 | | - $this->markTestSkipped( |
20 | | - 'This test only works in Laravel >= 8.2 and < 9' |
21 | | - ); |
22 | | - } |
23 | | - |
24 | | - Factory::guessFactoryNamesUsing(static::getFactoryNameResolver()); |
25 | | - |
26 | | - $command = $this->app->make(ModelsCommand::class); |
27 | | - |
28 | | - $tester = $this->runCommand($command, [ |
29 | | - '--write' => true, |
30 | | - ]); |
31 | | - |
32 | | - $this->assertSame(0, $tester->getStatusCode()); |
33 | | - $this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay()); |
34 | | - $this->assertStringNotContainsString('not found', $tester->getDisplay()); |
35 | | - $this->assertMatchesMockedSnapshot(); |
36 | | - } |
37 | | - |
38 | | - public function test_9(): void |
39 | | - { |
40 | | - if (!version_compare(Application::VERSION, '9', '>=')) { |
41 | | - $this->markTestSkipped( |
42 | | - 'This test only works in Laravel >= 9' |
43 | | - ); |
44 | | - } |
45 | | - |
46 | 17 | Factory::guessFactoryNamesUsing(static::getFactoryNameResolver()); |
47 | 18 |
|
48 | 19 | $command = $this->app->make(ModelsCommand::class); |
|
0 commit comments