/** * @expectedException InvalidArgumentException */ public function testReplaceItemException() { $this->storage->expects($this->once())->method('getMimeType')->with('key')->will($this->returnValue('text/html')); $file = $this->getMockBuilder('Zend_Form_Element_File')->disableOriginalConstructor()->getMock(); $file->expects($this->once())->method('getMimeType')->will($this->returnValue('binary/jpeg')); $this->service->replaceItem('key', $file); }
/** * Get metadata * * @return object */ private function getMetadata() { if (empty($this->metadata)) { $this->metadata = $this->storage->fetchMetadata($this->key); } return (object) $this->metadata; }
public function testGetRealpath() { $this->assertEquals(realpath("{$this->root}/dir"), $this->storage->getRealpath('dir')); }