Skip to content

Commit 9352de6

Browse files
GromNaNnicolas-grekas
authored andcommitted
Add TEST_GENERATE_FIXTURES=1 to generate fixtures in tests
1 parent 50924ea commit 9352de6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Tests/Builder/GeneratedConfigTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,11 @@ public function testConfig(string $name, string $alias)
8686
$expectedOutput = include $basePath.$name.'.output.php';
8787
$expectedCode = $basePath.$name;
8888

89-
// to regenerate snapshot files, uncomment these lines
90-
// (new Filesystem())->remove($expectedCode);
91-
// $this->generateConfigBuilder('Symfony\\Component\\Config\\Tests\\Builder\\Fixtures\\'.$name, $expectedCode);
92-
// $this->markTestIncomplete('Re-comment the line above and relaunch the tests');
89+
if ($_ENV['TEST_GENERATE_FIXTURES'] ?? false) {
90+
(new Filesystem())->remove($expectedCode);
91+
$this->generateConfigBuilder('Symfony\\Component\\Config\\Tests\\Builder\\Fixtures\\'.$name, $expectedCode);
92+
$this->markTestIncomplete('TEST_GENERATE_FIXTURES is set');
93+
}
9394

9495
$this->generateConfigBuilder('Symfony\\Component\\Config\\Tests\\Builder\\Fixtures\\'.$name, $outputDir);
9596

0 commit comments

Comments
 (0)