/** * @test */ public function getImgResourceHookGetsCalled() { $this->template->expects($this->atLeastOnce())->method('getFileName')->with('typo3/clear.gif')->will($this->returnValue('typo3/clear.gif')); $className = uniqid('tx_coretest'); $getImgResourceHookMock = $this->getMock('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectGetImageResourceHookInterface', array('getImgResourcePostProcess'), array(), $className); $getImgResourceHookMock->expects($this->once())->method('getImgResourcePostProcess')->will($this->returnCallback(array($this, 'isGetImgResourceHookCalledCallback'))); $getImgResourceHookObjects = array($getImgResourceHookMock); $this->cObj->_setRef('getImgResourceHookObjects', $getImgResourceHookObjects); $this->cObj->IMAGE($this->typoScriptImage); }
/** * @test * @expectedException \InvalidArgumentException */ public function setRefForEmptyPropertyNameInAccessibleMockObjectThrowsException() { $value = ''; $this->accessibleMock->_setRef('', $value); }