[HttpFoundation] Remove temporary files after tests run
This commit is contained in:
parent
ff4d446c5e
commit
d046fedefb
@ -129,6 +129,20 @@ class FileBagTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
protected function createTempFile()
|
||||
{
|
||||
return tempnam(sys_get_temp_dir(), 'FormTest');
|
||||
return tempnam(sys_get_temp_dir().'/form_test', 'FormTest');
|
||||
}
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
mkdir(sys_get_temp_dir().'/form_test', 0777, true);
|
||||
}
|
||||
|
||||
protected function tearDown()
|
||||
{
|
||||
foreach (glob(sys_get_temp_dir().'/form_test/*') as $file) {
|
||||
unlink($file);
|
||||
}
|
||||
|
||||
rmdir(sys_get_temp_dir().'/form_test');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user