本文整理汇总了PHP中TYPO3\CMS\Core\Resource\File::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP File::expects方法的具体用法?PHP File::expects怎么用?PHP File::expects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Resource\File
的用法示例。
在下文中一共展示了File::expects方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
/**
* Sets up this test case.
*/
protected function setUp()
{
$this->fileResourceMock = $this->getMock('TYPO3\\CMS\\Core\\Resource\\File', array('toArray', 'getModificationTime', 'getExtension'), array(), '', FALSE);
$this->folderResourceMock = $this->getMock('TYPO3\\CMS\\Core\\Resource\\Folder', array('getIdentifier'), array(), '', FALSE);
$this->mockFileProcessor = $this->getMock('TYPO3\\CMS\\Core\\Utility\\File\\ExtendedFileUtility', array('getErrorMessages'), array(), '', FALSE);
$this->fileResourceMock->expects($this->any())->method('toArray')->will($this->returnValue(array('id' => 'foo')));
$this->fileResourceMock->expects($this->any())->method('getModificationTime')->will($this->returnValue(123456789));
$this->fileResourceMock->expects($this->any())->method('getExtension')->will($this->returnValue('html'));
}
示例2: setUp
/**
* Sets up this test case.
*/
protected function setUp()
{
$this->fileResourceMock = $this->getMock(\TYPO3\CMS\Core\Resource\File::class, array('toArray', 'getModificationTime', 'getExtension'), array(), '', false);
$this->folderResourceMock = $this->getMock(\TYPO3\CMS\Core\Resource\Folder::class, array('getIdentifier'), array(), '', false);
$this->mockFileProcessor = $this->getMock(\TYPO3\CMS\Core\Utility\File\ExtendedFileUtility::class, array('getErrorMessages'), array(), '', false);
$this->fileResourceMock->expects($this->any())->method('toArray')->will($this->returnValue(array('id' => 'foo')));
$this->fileResourceMock->expects($this->any())->method('getModificationTime')->will($this->returnValue(123456789));
$this->fileResourceMock->expects($this->any())->method('getExtension')->will($this->returnValue('html'));
$this->request = new ServerRequest();
$this->response = new Response();
}
示例3: testWithDataAndSourceCollection
/**
* @return void
*/
public function testWithDataAndSourceCollection()
{
$this->file->expects($this->at(1))->method('process')->will($this->returnValue($this->processedFiles[1]));
$this->file->expects($this->at(2))->method('process')->will($this->returnValue($this->processedFiles[2]));
$this->file->expects($this->at(3))->method('process')->will($this->returnValue($this->processedFiles[0]));
$this->imageRendererConfiguration->expects($this->once())->method('getSourceCollection')->will($this->returnValue([10 => ['width' => '360m', 'dataKey' => 'small'], 20 => ['width' => '720m', 'dataKey' => 'small-retina']]));
$this->imageRendererConfiguration->expects($this->once())->method('getLayoutKey')->will($this->returnValue('data'));
$this->assertEquals('<img src="image.jpg" alt="alt" title="title" data-small="image360.jpg" data-small-retina="image720.jpg" />', $this->imageRenderer->render($this->file, '1000', '1000', []));
}