minor #19779 [FrameworkBundle] Fix test scanning the full tmp directory (chalasr)

This PR was merged into the 3.2-dev branch.

Discussion
----------

[FrameworkBundle] Fix test scanning the full tmp directory

| Q             | A
| ------------- | ---
| Branch?       | master
| Tests pass?   | yes/no
| Fixed tickets | n/a
| License       | MIT

Next to #19777 (my bad for both ☺️ ).

@nicolas-grekas It seems there are [some similar ones](https://github.com/search?utf8=%E2%9C%93&q=tempnam%28sys_get_temp_dir%28%29%2C+repo%3Asymfony%2Fsymfony&type=Code&ref=searchresults) that need to be fixed

Commits
-------

bb9413b [FrameworkBundle] Fix test scanning the full tmp directory
This commit is contained in:
Fabien Potencier 2016-08-30 10:58:27 -07:00
commit 2bc54e0863
1 changed files with 4 additions and 1 deletions

View File

@ -67,7 +67,7 @@ bar';
*/
private function createFile($content)
{
$filename = tempnam(sys_get_temp_dir(), 'sf-');
$filename = tempnam(sys_get_temp_dir().'/framework-yml-lint-test', 'sf-');
file_put_contents($filename, $content);
$this->files[] = $filename;
@ -90,6 +90,7 @@ bar';
protected function setUp()
{
$this->files = array();
@mkdir(sys_get_temp_dir().'/framework-yml-lint-test');
}
protected function tearDown()
@ -99,5 +100,7 @@ bar';
unlink($file);
}
}
rmdir(sys_get_temp_dir().'/framework-yml-lint-test');
}
}