/**
  * Returns file contents as string
  * @return string
  * @throws NotReadableException
  */
 public function toString()
 {
     if (!FileSystemHelper::isReadableFile($this->getFile())) {
         throw new NotReadableException($this->getFile());
     }
     return file_get_contents($this->getFile());
 }
Exemple #2
0
 /**
  * @covers Corgi\File\File::copy
  * @depends testTouch
  */
 public function testCopy()
 {
     $file = new File($this->fullTestFilePath);
     $file->touch();
     $copyPath = $this->getCopyPath($file);
     $this->assertInstanceOf(get_class($file), $file->copy($copyPath));
     $this->assertTrue(FileSystemHelper::isReadableFile($copyPath));
 }
 /**
  * @covers Corgi\File\Helpers\FileSystemHelper::isReadableFile
  */
 public function testIsReadableFile()
 {
     $this->assertBool(FileSystemHelper::isReadableFile());
 }