file: update glob function to clean correctely in relative mode

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3736 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2017-05-30 08:43:26 +00:00
parent e4e5e5931b
commit 683d5b0a51
2 changed files with 34 additions and 1 deletions

View File

@@ -438,4 +438,34 @@ class test_file extends PHPUnit_Framework_TestCase
$res = $file->mkdir ("/testDFFileDir/tptp/titi/poo", 0777, true);
$this->assertSame ($res, true);
}
public function test_glob_1 ()
{
$file = new file ();
$file->chroot ("/tmp");
$res = $file->glob ("/testDFFileDir/*");
$this->assertSame ($res, array ("/testDFFileDir/toto",
"/testDFFileDir/tptp"));
}
public function test_glob_2 ()
{
$file = new file ();
$file->chroot ("/tmp");
$file->chdir ("/testDFFileDir");
$res = $file->glob ("*");
$this->assertSame ($res, array ("toto",
"tptp"));
}
public function test_glob_3 ()
{
$file = new file ();
$file->chroot ("/tmp");
$file->chdir ("/testDFFileDir");
$res = $file->glob ("/testDFFileDir/*");
$this->assertSame ($res, array ("/testDFFileDir/toto",
"/testDFFileDir/tptp"));
}
}