diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/YamlLintCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/YamlLintCommandTest.php index c4b7547248b7d..30ffa76c23e81 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/YamlLintCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/YamlLintCommandTest.php @@ -115,7 +115,7 @@ public function testLintFilesFromBundleDirectory() */ private function createFile($content) { - $filename = tempnam(sys_get_temp_dir(), 'sf-'); + $filename = tempnam(sys_get_temp_dir().'/yml-lint-test', 'sf-'); file_put_contents($filename, $content); $this->files[] = $filename; @@ -152,7 +152,7 @@ private function getKernelAwareApplicationMock() ->expects($this->once()) ->method('locateResource') ->with('@AppBundle/Resources') - ->willReturn(sys_get_temp_dir()); + ->willReturn(sys_get_temp_dir().'/yml-lint-test'); $application = $this->getMockBuilder(Application::class) ->disableOriginalConstructor() @@ -184,6 +184,7 @@ private function getKernelAwareApplicationMock() protected function setUp() { + @mkdir(sys_get_temp_dir().'/yml-lint-test'); $this->files = array(); } @@ -194,5 +195,6 @@ protected function tearDown() unlink($file); } } + rmdir(sys_get_temp_dir().'/yml-lint-test'); } }