8000 minor #19777 [Yaml] Fix test scanning the full tmp directory (nicolas… · symfony/symfony@9b39c7a · GitHub
[go: up one dir, main page]

Skip to content

Commit 9b39c7a

Browse files
committed
minor #19777 [Yaml] Fix test scanning the full tmp directory (nicolas-grekas)
This PR was merged into the 3.2-dev branch. Discussion ---------- [Yaml] Fix test scanning the full tmp directory | Q | A | ------------- | --- | Branch? | master | Tests pass? | yes | Fixed tickets | - | License | MIT Commits ------- d2d4b3c [Yaml] Fix test scanning the full tmp directory
2 parents 6f2ea67 + d2d4b3c commit 9b39c7a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/Command/YamlLintCommandTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function testLintFilesFromBundleDirectory()
115115
*/
116116
private function createFile($content)
117117
{
118-
$filename = tempnam(sys_get_temp_dir(), 'sf-');
118+
$filename = tempnam(sys_get_temp_dir().'/yml-lint-test', 'sf-');
119119
file_put_contents($filename, $content);
120120

121121
$this->files[] = $filename;
@@ -152,7 +152,7 @@ private function getKernelAwareApplicationMock()
152152
->expects($this->once())
153153
->method('locateResource')
154154
->with('@AppBundle/Resources')
155-
->willReturn(sys_get_temp_dir());
155+
->willReturn(sys_get_temp_dir().'/yml-lint-test');
156156

157157
$application = $this->getMockBuilder(Application::class)
158158
->disableOriginalConstructor()
@@ -184,6 +184,7 @@ private function getKernelAwareApplicationMock()
184184

185185
protected function setUp()
186186
{
187+
@mkdir(sys_get_temp_dir().'/yml-lint-test');
187188
$this->files = array();
188189
}
189190

@@ -194,5 +195,6 @@ protected function tearDown()
194195
unlink($file);
195196
}
196197
}
198+
rmdir(sys_get_temp_dir().'/yml-lint-test');
197199
}
198200
}

0 commit comments

Comments
 (0)
0