/** * @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(); }
/** * @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); }
/** * @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')); }