/** * @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 testReadSourceLines() { $file = new Filesystem(); $dir = static::getTempPath(__FUNCTION__); mkdir($dir); $filename = rand(1, 10) . rand(0, getrandmax()); $path = $dir . DIRECTORY_SEPARATOR . $filename; touch($path); $input = null; for ($i = 0; $i <= 100; $i++) { $input .= $i . '_abc'; $input .= PHP_EOL; } file_put_contents($path, $input); $expect = "13_abc\n14_abc\n15_abc\n16_abc\n17_abc\n"; $this->assertEquals($expect, $file->readFileSeek($path, 15, 2)); }