Skip to content

Commit cc92a63

Browse files
[Yaml] Fix test scanning the full tmp directory
1 parent a5afce6 commit cc92a63

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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)