/** * @test */ public function testEmptyFile() { $file = new Filesystem(); $dir = static::getTempPath(__FUNCTION__); mkdir($dir); $filename = rand(1, 10) . rand(0, getrandmax()); $path = $dir . DIRECTORY_SEPARATOR . $filename; file_put_contents($path, __FUNCTION__); $file->emptyFile($path); $fileempty = file_get_contents($path); $this->assertEquals(empty($fileempty), empty(file_get_contents($path))); }