25 protected $className =
'Vendor\\Ext\\Domain\\Model\\ClubMate';
43 $this->dataMap = $this->getMock(
'TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMap', array(
'getIsStatic',
'getRootLevel'), array(
'Vendor\\Ext\\Domain\\Model\\ClubMate',
'tx_ext_domain_model_clubmate'));
45 $this->queryFactory = $this->
getAccessibleMock(
'TYPO3\CMS\Extbase\Persistence\Generic\QueryFactory', array(
'dummy'));
46 $this->queryFactory->_set(
'configurationManager',
47 $this->getMock(
'TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface')
50 $this->dataMapper = $this->getMock(
'TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapper', array(
'getDataMap',
'convertClassNameToTableName'));
51 $this->dataMapper->expects($this->any())->method(
'getDataMap')->will($this->returnValue($this->dataMap));
52 $this->queryFactory->_set(
'dataMapper', $this->dataMapper);
57 'Respect storage page is set when entity is neither marked as static nor as rootLevel.' => array(FALSE, FALSE, TRUE),
58 'Respect storage page is set when entity is marked as static and rootLevel.' => array(TRUE, TRUE, FALSE),
59 'Respect storage page is set when entity is marked as static but not rootLevel.' => array(TRUE, FALSE, FALSE),
60 'Respect storage page is set when entity is not marked as static but as rootLevel.' => array(FALSE, TRUE, FALSE),
72 public function createDoesNotRespectStoragePageIfStaticOrRootLevelIsTrue($static, $rootLevel, $expectedResult) {
74 $objectManager = $this->getMock(
'TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
75 $this->queryFactory->_set(
'objectManager', $objectManager);
77 $this->dataMap->expects($this->any())->method(
'getIsStatic')->will($this->returnValue($static));
78 $this->dataMap->expects($this->any())->method(
'getRootLevel')->will($this->returnValue($rootLevel));
80 $query = $this->getMock(
'TYPO3\\CMS\\Extbase\\Persistence\\QueryInterface');
81 $objectManager->expects($this->at(0))->method(
'get')
82 ->with(
'TYPO3\\CMS\\Extbase\\Persistence\\QueryInterface')
83 ->will($this->returnValue($query));
85 $querySettings = new \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings();
86 $objectManager->expects($this->at(1))->method(
'get')
87 ->with(
'TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface')
88 ->will($this->returnValue($querySettings));
89 $query->expects($this->once())->method(
'setQuerySettings')->with($querySettings);
90 $this->queryFactory->create($this->className);
94 $querySettings->getRespectStoragePage()
getAccessibleMock( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)
getStaticAndRootLevelAndExpectedResult()