public function getFileInfo() { $fileName = __DIR__ . '/testRead.txt'; $file = new File($fileName); $info = $file->getFileInfo(); $this->assertSame(filemtime($fileName), $info->getMTime()); }
public function __construct($fileName) { $path = dirname($fileName); if (!is_dir($path) && !mkdir($path, 0777, TRUE)) { throw new RuntimeException('Can\'t open writeable directory. ' . $path); } parent::__construct($fileName, 'w'); }
public function testRead() { $fileName = __DIR__ . '/testRead.txt'; $file = new File($fileName); $this->assertSame(file_get_contents($fileName), $file->read()); }