Exemplo n.º 1
0
 /**
  * @covers Corgi\File\Base\FileSystemNode::getPath
  */
 public function testGetPath()
 {
     $file = new File($this->fullTestFilePath);
     $file->touch();
     $this->assertInternalType('string', $file->getPath());
     $file->delete();
     $directory = new Directory($this->fullTestFilePath);
     $directory->create();
     $this->assertInternalType('string', $directory->getPath());
     $directory->delete();
 }
Exemplo n.º 2
0
 /**
  * @covers Corgi\File\Directory::iterate
  * @depends testCreate
  */
 public function testIterate()
 {
     $iterations = new \stdClass();
     $iterations->flag = false;
     $closure = function () use($iterations) {
         $iterations->flag = true;
     };
     $directory = new Directory(dirname($this->fullTestFilePath));
     $file = new File($this->fullTestFilePath);
     $directory->create();
     $file->touch();
     $directory->iterate($closure);
     $file->delete();
     $directory->delete();
     $this->assertTrue($iterations->flag);
 }
Exemplo n.º 3
0
 /**
  * @covers Corgi\File\File::delete
  * @depends testTouch
  */
 public function testDelete()
 {
     $file = new File($this->fullTestFilePath);
     $file->touch();
     $this->assertBool($file->delete());
 }
 public function setUp()
 {
     $this->file = new File($this->testFilePath);
     $this->file->touch();
     $this->testFileContents = md5(date('YmdHis'));
 }