示例#1
0
 /**
  * @test
  */
 public function testSetChmodRecursive()
 {
     $file = new Filesystem();
     $dir = static::getTempPath(__FUNCTION__);
     $file1 = rand(1, 10) . rand(0, getrandmax());
     mkdir($dir);
     $filepath1 = $dir . DIRECTORY_SEPARATOR . $file1;
     $file2 = rand(1, 10) . rand(0, getrandmax());
     $filepath2 = $dir . DIRECTORY_SEPARATOR . $file2;
     mkdir($filepath2);
     $file3 = rand(1, 10) . rand(0, getrandmax());
     file_put_contents($filepath2 . DIRECTORY_SEPARATOR . $file3, __FUNCTION__, FILE_APPEND);
     file_put_contents($filepath1, __FUNCTION__, FILE_APPEND);
     $file->setChmodRecursive($dir, 0733);
     $this->assertEquals("733", $file->getFileSystemInfo($filepath2 . DIRECTORY_SEPARATOR . $file3)->getFilePermission());
 }