Beispiel #1
0
 public function getFileInfo()
 {
     $fileName = __DIR__ . '/testRead.txt';
     $file = new File($fileName);
     $info = $file->getFileInfo();
     $this->assertSame(filemtime($fileName), $info->getMTime());
 }
Beispiel #2
0
 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');
 }
Beispiel #3
0
 public function testRead()
 {
     $fileName = __DIR__ . '/testRead.txt';
     $file = new File($fileName);
     $this->assertSame(file_get_contents($fileName), $file->read());
 }