Exemplo n.º 1
0
 /**
  * @param string $fileName
  *      The name of the file to save
  * @param string $fullPath
  *      The full path of where to save the file
  * @return \Extended\File\Tmp;
  * @throws \Extended\Exception\FileException
  *      If the file could not be saved
  */
 public function save($name, $path = null)
 {
     $this->name = $name;
     if ($path) {
         $this->path = $path;
     }
     parent::save();
     return $this;
 }
Exemplo n.º 2
0
 public function testOpenFile()
 {
     static::setupTestFile();
     $file = new File(static::$path);
     $expected = 'test';
     $file->readBuffer($expected);
     $fileOutput = trim($file->writeBuffer());
     $this->assertEquals($expected, $fileOutput);
     $this->assertInstanceOf('\\Extended\\File\\File', $file->save());
     $file2 = new File(static::$path, 'r');
     $fileOuput = trim($file2->writeBuffer());
     $this->assertEquals($expected, $fileOutput);
 }