/** * @test */ public function testgetDiskTotalUsage() { $fs = new Filesystem(); $comparediskspace = (int) disk_total_space(__FILE__) - (int) disk_free_space(__FILE__); $this->assertEquals($comparediskspace, $fs->getFileSystemInfo(__DIR__)->getDiskTotalUsage()); }
/** * @test */ public function testSetChown() { $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->setChown($dir, 1000, true); $this->assertEquals(1000, $file->getFileSystemInfo($dir)->getFileGroup()); }