本文整理汇总了PHP中TYPO3\CMS\Frontend\Page\PageRepository::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP PageRepository::expects方法的具体用法?PHP PageRepository::expects怎么用?PHP PageRepository::expects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Frontend\Page\PageRepository
的用法示例。
在下文中一共展示了PageRepository::expects方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: migrationOfLegacyFieldsIsOnlyDoneWhenRelationFieldIsVisibleInType
/**
* @test
* @dataProvider conteRowsOfDifferentTypesDataProvider
*/
public function migrationOfLegacyFieldsIsOnlyDoneWhenRelationFieldIsVisibleInType($dbRow, $expectedCaption, $fileProperties)
{
$fileReference = $this->getMock('TYPO3\\CMS\\Core\\Resource\\FileReference', array(), array(), '', FALSE);
$fileReference->expects($this->once())->method('getProperties')->will($this->returnValue($fileProperties));
$fileReference->expects($this->any())->method('getOriginalFile')->will($this->returnValue($this->getMock('TYPO3\\CMS\\Core\\Resource\\File', array(), array(), '', FALSE)));
$fileReference->expects($this->any())->method('getPublicUrl')->will($this->returnValue('path/to/file'));
$this->pageRepositoryMock->expects($this->any())->method('getFileReferences')->will($this->returnValue(array($fileReference)));
\TYPO3\CMS\Core\Resource\Service\FrontendContentAdapterService::modifyDBRow($dbRow, 'tt_content');
$this->assertSame($expectedCaption, $dbRow['imagecaption']);
}
示例2: enrichWithRelationFieldsCreatesWhereClauseForDisabledField
/**
* @test
*/
public function enrichWithRelationFieldsCreatesWhereClauseForDisabledField()
{
$mockDatabaseConnection = $this->getMock(\TYPO3\CMS\Core\Database\DatabaseConnection::class, array('exec_SELECTgetRows'), array(), '', false);
$subject = $this->getAccessibleMock(\TYPO3\CMS\Core\Utility\RootlineUtility::class, array('columnHasRelationToResolve'), array(1, '', $this->pageContextMock));
$subject->_set('databaseConnection', $mockDatabaseConnection);
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageOverlayFields'] = '';
$foreign_table = $this->getUniqueId('foreign_table');
$foreign_field = $this->getUniqueId('foreign_field');
$GLOBALS['TCA'][$foreign_table]['ctrl']['enablecolumns']['disabled'] = $this->getUniqueId('disabled');
$GLOBALS['TCA']['pages']['columns'] = array('test' => array('config' => array('foreign_table' => $foreign_table, 'foreign_field' => $foreign_field)));
$expected = array($foreign_field . ' = 0', $foreign_table . '.' . $GLOBALS['TCA'][$foreign_table]['ctrl']['enablecolumns']['disabled'] . ' = 0');
$this->pageContextMock->expects($this->once())->method('deleteClause')->will($this->returnValue(''));
$mockDatabaseConnection->expects($this->once())->method('exec_SELECTgetRows')->with('uid', $foreign_table, implode(' AND ', $expected), '', '', '', '')->will($this->returnValue(array('uid' => 17)));
$subject->expects($this->once())->method('columnHasRelationToResolve')->will($this->returnValue(true));
$subject->_call('enrichWithRelationFields', 17, array());
}
示例3: setUp
/**
* Sets up this testcase
*/
public function setUp()
{
$GLOBALS['TYPO3_DB'] = $this->getMock('TYPO3\\CMS\\Core\\Database\\DatabaseConnection', array('exec_SELECTquery', 'sql_fetch_assoc', 'sql_free_result'));
$this->pageSelectObject = $this->getAccessibleMock('TYPO3\\CMS\\Frontend\\Page\\PageRepository', array('getMultipleGroupsWhereClause'));
$this->pageSelectObject->expects($this->any())->method('getMultipleGroupsWhereClause')->will($this->returnValue(' AND 1=1'));
}