From d2d4b3ca82106733e821153fc5755ab6262f8c22 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 29 Aug 2016 17:14:38 +0200 Subject: [PATCH] [Yaml] Fix test scanning the full tmp directory --- .../FrameworkBundle/Tests/Command/YamlLintCommandTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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'); } }