當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。