public function testFilePrivate(){ $src = new \Core\Filestore\Backends\FileLocal('core/tests/ivak_TV_Test_Screen.png'); $dst = \Core\Filestore\Factory::File('private/tests/ivak_TV_Test_Screen.png'); // Verify that this is a valid object. $this->assertInstanceOf('\Core\Filestore\File', $dst); // Make sure it's writable... just because :p $src->copyTo($dst); $this->assertTrue($dst->exists()); }
public function testCopyTo() { $file = new \Core\Filestore\Backends\FileLocal('core/tests/updater-testdocument.txt'); // I should be able to copy to a filename. // this gets resolved to a local file. $copy = $file->copyTo('tmp/tests-filelocaltest-testcopyto.dat'); $this->assertInstanceOf('\\Core\\Filestore\\File', $copy); $this->assertTrue($copy->exists()); $this->assertTrue($copy->delete()); // And it should be able to copy to a local file object. $copy = new \Core\Filestore\Backends\FileLocal('tmp/tests-filelocaltest-testcopyto.dat'); $this->assertFalse($copy->exists()); $file->copyTo($copy); $this->assertTrue($copy->exists()); $this->assertTrue($copy->delete()); }