当前位置: 首页>>代码示例>>PHP>>正文


PHP File::expects方法代码示例

本文整理汇总了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'));
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:12,代码来源:FileControllerTest.php

示例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();
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:14,代码来源:FileControllerTest.php

示例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', []));
 }
开发者ID:alexanderschnitzler,项目名称:fluid-styled-responsive-images,代码行数:12,代码来源:ImageRenderingTest.php


注:本文中的TYPO3\CMS\Core\Resource\File::expects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。