mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/10941] tearDown() now uses explicit file list
Instances of $it also renamed for clarity. PHPBB3-10941
This commit is contained in:
parent
82ca2c8b08
commit
f2bbbdaafa
1 changed files with 19 additions and 5 deletions
|
@ -43,8 +43,8 @@ class phpbb_filespec_test extends phpbb_test_case
|
||||||
$this->init_filespec();
|
$this->init_filespec();
|
||||||
|
|
||||||
// Create copies of the files for use in testing move_file
|
// Create copies of the files for use in testing move_file
|
||||||
$it = new DirectoryIterator($this->path);
|
$iterator = new DirectoryIterator($this->path);
|
||||||
foreach ($it as $fileinfo)
|
foreach ($iterator as $fileinfo)
|
||||||
{
|
{
|
||||||
if ($fileinfo->isDot())
|
if ($fileinfo->isDot())
|
||||||
{
|
{
|
||||||
|
@ -142,10 +142,24 @@ class phpbb_filespec_test extends phpbb_test_case
|
||||||
|
|
||||||
protected function tearDown()
|
protected function tearDown()
|
||||||
{
|
{
|
||||||
$it = new DirectoryIterator($this->path);
|
$files = array(
|
||||||
foreach ($it as $fileinfo)
|
'gif_copy' => 1,
|
||||||
|
'jpg_copy' => 1,
|
||||||
|
'png_copy' => 1,
|
||||||
|
'txt_copy' => 1,
|
||||||
|
'txt_copy_2' => 1,
|
||||||
|
'tif_copy' => 1,
|
||||||
|
'gif_moved' => 1,
|
||||||
|
'jpg_moved' => 1,
|
||||||
|
'png_moved' => 1,
|
||||||
|
'txt_as_img' => 1,
|
||||||
|
'txt_moved' => 1,
|
||||||
|
);
|
||||||
|
|
||||||
|
$iterator = new DirectoryIterator($this->path);
|
||||||
|
foreach ($iterator as $fileinfo)
|
||||||
{
|
{
|
||||||
if (strlen($fileinfo->getFilename()) > 3)
|
if (isset($files[$fileinfo->getFilename()]))
|
||||||
{
|
{
|
||||||
unlink($fileinfo->getPathname());
|
unlink($fileinfo->getPathname());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue