This commit is contained in:
Ahmed Fathy
2021-03-31 23:03:55 +02:00
parent 92d7f2e706
commit b19b1d69ba
4 changed files with 109 additions and 0 deletions
@@ -28,4 +28,23 @@ class Test extends AbstractModelsCommand
$this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay());
$this->assertMatchesMockedSnapshot();
}
/** @test */
public function it_doesnt_generate_phpdoc_for_model_doesnt_have_factory()
{
if (!version_compare(Application::VERSION, '8.2', '>=')) {
$this->markTestSkipped(
'This test only works in Laravel >= 8.2'
);
}
$command = $this->app->make(ModelsCommand::class);
$tester = $this->runCommand($command, [
'--write' => true,
]);
$this->assertStringNotContainsString('not found', $tester->getDisplay());
$this->assertMatchesMockedSnapshot();
}
}