/** * Sets up this test case * * @return void */ protected function setUp() { $this->query = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Persistence\Generic\Query::class, array('dummy'), array('someType')); $this->querySettings = $this->getMock(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface::class); $this->query->_set('querySettings', $this->querySettings); $this->persistenceManager = $this->getMock(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::class); $this->backend = $this->getMock(\TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface::class); $this->backend->expects($this->any())->method('getQomFactory')->will($this->returnValue(NULL)); $this->persistenceManager->expects($this->any())->method('getBackend')->will($this->returnValue($this->backend)); $this->query->_set('persistenceManager', $this->persistenceManager); $this->dataMapper = $this->getMock(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper::class); $this->query->_set('dataMapper', $this->dataMapper); }
/** * Sets up this test case * * @return void */ protected function setUp() { $this->query = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Persistence\Generic\Query::class, array('dummy'), array('someType')); $this->querySettings = $this->getMock(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface::class); $this->query->_set('querySettings', $this->querySettings); $this->persistenceManager = $this->getMock(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::class); $this->backend = $this->getMock(\TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface::class); $this->backend->expects($this->any())->method('getQomFactory')->will($this->returnValue(null)); $this->persistenceManager->expects($this->any())->method('getBackend')->will($this->returnValue($this->backend)); $this->query->_set('persistenceManager', $this->persistenceManager); $this->dataMapper = $this->getMock(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper::class); $this->query->_set('dataMapper', $this->dataMapper); $this->controller = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller\PaginateController::class, array('dummy'), array(), '', false); $this->controller->_set('view', $this->getMock(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface::class)); }
/** * Tear down the persistence * * This method is called in functional tests to reset the storage between tests. * The implementation is optional and depends on the underlying persistence backend. * * @return void */ public function tearDown() { if (method_exists($this->backend, 'tearDown')) { $this->backend->tearDown(); } }