示例#1
0
 public function testIsFileDeletedById()
 {
     $id = $this->storage()->save(Test\Data::gif1x1());
     $expectedPath = $this->storage_path . $id;
     $this->storage()->delete($id);
     $this->assertFalse(file_exists($expectedPath));
 }
示例#2
0
 public function testIsContentSavedInFileSystemInGroupDirectory()
 {
     $id = $this->cache()->save(Test\Data::gif1x1(), new Request('/adm/7yU98sd_1x1.gif'));
     $path = $this->cache_path . nonlinear\generateDestination($id);
     $expectedPath = $path . '/adm/7yU98sd/7yU98sd_1x1.gif';
     $this->assertEquals(file_get_contents($expectedPath), Test\Data::gif1x1());
 }
示例#3
0
 private function partiallyMockedCollection(array $specs = null, $readFile = null)
 {
     $partialMock = $this->partiallyMockedEmptyCollection($specs);
     $partialMock->expects($this->any())->method('readTempFile')->will($this->returnValue($readFile ?: Test\Data::gif1x1()));
     return $partialMock;
 }
示例#4
0
 private static function aGifStorageStub()
 {
     return Test\Stub::create('Barberry\\Storage\\StorageInterface', 'getById', Test\Data::gif1x1());
 }
示例#5
0
 public function testReturnsTheArgument()
 {
     $c = new Null();
     $this->assertEquals(Test\Data::gif1x1(), $c->convert(Test\Data::gif1x1()));
 }