/** * Setup the test */ public function setup() { $this->subject = $this->getMock('Etobi\\CoreApi\\Service\\CacheApiService', array('clear_cacheCmd')); $this->dataHandlerMock = $this->getMock('TYPO3\\CMS\\Core\\DataHandling\\DataHandler', array('clear_cacheCmd')); $this->objectManagerMock = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManager'); $this->backendUserAuthenticationMock = $this->getMock('TYPO3\\CMS\\Core\\Authentication\\BackendUserAuthentication', array('dummy')); $this->objectManagerMock->expects($this->once())->method('get')->will($this->returnValue($this->backendUserAuthenticationMock)); $this->subject->injectDataHandler($this->dataHandlerMock); $this->subject->injectObjectManager($this->objectManagerMock); $this->subject->initializeObject(); }