Skip to content

Commit c3eb27f

Browse files
minor #61140 [Config] Fix GeneratedConfigTest not being able to generate snapshots anymore (KevinVanSonsbeek)
This PR was merged into the 7.2 branch. Discussion ---------- [Config] Fix GeneratedConfigTest not being able to generate snapshots anymore | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | Fix #61139 | License | MIT PR #57614 Removed multiple uses of `uniqid`. In the specific PR changes were made to the GeneratedConfigTest, to change how the directory was built for the config. This inadvertedly broke the generating of snapshot files, due to the outputDir being changed to a by reference argument, and always overwriting the value to a temp dir. (While the snapshot files should not be written to a temp dir) Commits ------- 8e8daf1 bugfix(#61139): Only generate an outputDir if none is set.
2 parents dabfa59 + 8e8daf1 commit c3eb27f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Symfony/Component/Config/Tests/Builder/GeneratedConfigTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,12 @@ public function testSetExtraKeyMethodIsNotGeneratedWhenAllowExtraKeysIsFalse()
159159
*/
160160
private function generateConfigBuilder(string $configurationClass, ?string &$outputDir = null)
161161
{
162-
$outputDir = tempnam(sys_get_temp_dir(), 'sf_config_builder_');
163-
unlink($outputDir);
164-
mkdir($outputDir);
165-
$this->tempDir[] = $outputDir;
162+
if (null === $outputDir) {
163+
$outputDir = tempnam(sys_get_temp_dir(), 'sf_config_builder_');
164+
unlink($outputDir);
165+
mkdir($outputDir);
166+
$this->tempDir[] = $outputDir;
167+
}
166168

167169
$configuration = new $configurationClass();
168170
$rootNode = $configuration->getConfigTreeBuilder()->buildTree();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy