mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
Fix model factory method arguments for Laravel >= 9 (#1361)
This commit is contained in:
@@ -13,11 +13,33 @@ use Illuminate\Support\Str;
|
||||
|
||||
class Test extends AbstractModelsCommand
|
||||
{
|
||||
public function test(): void
|
||||
public function test_8(): void
|
||||
{
|
||||
if (!version_compare(Application::VERSION, '8.2', '>=')) {
|
||||
if (!version_compare(Application::VERSION, '8.2', '>=') || !version_compare(Application::VERSION, '9', '<')) {
|
||||
$this->markTestSkipped(
|
||||
'This test only works in Laravel >= 8.2'
|
||||
'This test only works in Laravel >= 8.2 and < 9'
|
||||
);
|
||||
}
|
||||
|
||||
Factory::guessFactoryNamesUsing(static::getFactoryNameResolver());
|
||||
|
||||
$command = $this->app->make(ModelsCommand::class);
|
||||
|
||||
$tester = $this->runCommand($command, [
|
||||
'--write' => true,
|
||||
]);
|
||||
|
||||
$this->assertSame(0, $tester->getStatusCode());
|
||||
$this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay());
|
||||
$this->assertStringNotContainsString('not found', $tester->getDisplay());
|
||||
$this->assertMatchesMockedSnapshot();
|
||||
}
|
||||
|
||||
public function test_9(): void
|
||||
{
|
||||
if (!version_compare(Application::VERSION, '9', '>=')) {
|
||||
$this->markTestSkipped(
|
||||
'This test only works in Laravel >= 9'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user