Skip to content

Commit cce0244

Browse files
committed
Crud: Add test for test-generation
1 parent 1b4486f commit cce0244

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/Maker/MakeCrudTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,26 @@ public function getTestDetails()
3636
->setRequiredPhpVersion(70200),
3737
];
3838

39+
yield 'crud_basic_tests' => [MakerTestDetails::createTest(
40+
$this->getMakerInstance(MakeCrud::class),
41+
[
42+
// entity class name
43+
'SweetFood',
44+
])
45+
->setFixtureFilesPath(__DIR__.'/../fixtures/MakeCrud')
46+
->addExtraDependencies('symfony/css-selector')
47+
->addExtraDependencies('symfony/browser-kit')
48+
// need for crud web tests
49+
->configureDatabase()
50+
->assert(function (string $output, string $directory) {
51+
$this->assertStringContainsString('created: src/Controller/SweetFoodController.php', $output);
52+
$this->assertStringContainsString('created: src/Form/SweetFoodType.php', $output);
53+
$this->assertStringContainsString('created: tests/Controller/SweetFoodControllerTest.php', $output);
54+
})
55+
// workaround for segfault in PHP 7.1 CI :/
56+
->setRequiredPhpVersion(70200),
57+
];
58+
3959
yield 'crud_basic_in_custom_root_namespace' => [MakerTestDetails::createTest(
4060
$this->getMakerInstance(MakeCrud::class),
4161
[

0 commit comments

Comments
 (0)