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


PHP Environment::expects方法代码示例

本文整理汇总了PHP中TYPO3\Flow\Utility\Environment::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP Environment::expects方法的具体用法?PHP Environment::expects怎么用?PHP Environment::expects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\Flow\Utility\Environment的用法示例。


在下文中一共展示了Environment::expects方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setCacheThrowsExceptionOnNonWritableDirectory

 /**
  * @test
  * @expectedException \TYPO3\Flow\Cache\Exception
  */
 public function setCacheThrowsExceptionOnNonWritableDirectory()
 {
     $this->mockEnvironment = $this->getMockBuilder(\TYPO3\Flow\Utility\Environment::class)->disableOriginalConstructor()->getMock();
     $this->mockEnvironment->expects($this->any())->method('getMaximumPathLength')->will($this->returnValue(1024));
     $this->mockEnvironment->expects($this->any())->method('getPathToTemporaryDirectory')->will($this->returnValue('vfs://non/existing/directory'));
     $this->getSimpleFileBackend();
 }
开发者ID:kszyma,项目名称:flow-development-collection,代码行数:11,代码来源:SimpleFileBackendTest.php

示例2: setUp

 /**
  * Creates the mocked filesystem used in the tests
  */
 public function setUp()
 {
     vfsStream::setup('Foo');
     $this->mockEnvironment = $this->getMock('TYPO3\\Flow\\Utility\\Environment', array(), array(), '', FALSE);
     $this->mockEnvironment->expects($this->any())->method('getPathToTemporaryDirectory')->will($this->returnValue('vfs://Foo/'));
     $this->mockEnvironment->expects($this->any())->method('getMaximumPathLength')->will($this->returnValue(1024));
 }
开发者ID:sokunthearith,项目名称:Intern-Project-Week-2,代码行数:10,代码来源:CacheFactoryTest.php

示例3: setUp

 public function setUp()
 {
     $this->mockDirectory = vfsStream::setup('WritableFileSystemStorageTest');
     $this->writableFileSystemStorage = $this->getAccessibleMock(WritableFileSystemStorage::class, null, ['testStorage', ['path' => 'vfs://WritableFileSystemStorageTest/']]);
     $this->mockEnvironment = $this->getMockBuilder(Environment::class)->disableOriginalConstructor()->getMock();
     $this->mockEnvironment->expects($this->any())->method('getPathToTemporaryDirectory')->will($this->returnValue('vfs://WritableFileSystemStorageTest/'));
     $this->inject($this->writableFileSystemStorage, 'environment', $this->mockEnvironment);
 }
开发者ID:kszyma,项目名称:flow-development-collection,代码行数:8,代码来源:WritableFileSystemStorageTest.php

示例4: setUp

 /**
  * Creates the mocked filesystem used in the tests
  */
 public function setUp()
 {
     vfsStream::setup('Foo');
     $this->mockEnvironment = $this->getMockBuilder(\TYPO3\Flow\Utility\Environment::class)->disableOriginalConstructor()->getMock();
     $this->mockEnvironment->expects($this->any())->method('getPathToTemporaryDirectory')->will($this->returnValue('vfs://Foo/'));
     $this->mockEnvironment->expects($this->any())->method('getMaximumPathLength')->will($this->returnValue(1024));
     $this->mockCacheManager = $this->getMockBuilder(\TYPO3\Flow\Cache\CacheManager::class)->disableOriginalConstructor()->setMethods(array('registerCache', 'isCachePersistent'))->getMock();
     $this->mockCacheManager->expects($this->any())->method('isCachePersistent')->will($this->returnValue(false));
 }
开发者ID:cerlestes,项目名称:flow-development-collection,代码行数:12,代码来源:CacheFactoryTest.php

示例5: setUp

 /**
  * Creates the mocked filesystem used in the tests
  */
 public function setUp()
 {
     vfsStream::setup('Foo');
     $this->mockEnvironment = $this->getMock(\TYPO3\Flow\Utility\Environment::class, array(), array(), '', FALSE);
     $this->mockEnvironment->expects($this->any())->method('getPathToTemporaryDirectory')->will($this->returnValue('vfs://Foo/'));
     $this->mockEnvironment->expects($this->any())->method('getMaximumPathLength')->will($this->returnValue(1024));
     $this->mockCacheManager = $this->getMock(\TYPO3\Flow\Cache\CacheManager::class, array('registerCache'), array(), '', FALSE);
     $this->mockCacheManager->expects($this->any())->method('isCachePersistent')->will($this->returnValue(FALSE));
 }
开发者ID:nlx-sascha,项目名称:flow-development-collection,代码行数:12,代码来源:CacheFactoryTest.php

示例6: setUp

 public function setUp()
 {
     vfsStream::setup('Foo');
     $this->cacheManager = new \TYPO3\Flow\Cache\CacheManager();
     $this->mockEnvironment = $this->getMockBuilder(\TYPO3\Flow\Utility\Environment::class)->disableOriginalConstructor()->getMock();
     $this->mockEnvironment->expects($this->any())->method('getPathToTemporaryDirectory')->will($this->returnValue('vfs://Foo/'));
     $this->cacheManager->injectEnvironment($this->mockEnvironment);
     $this->mockSystemLogger = $this->getMock(\TYPO3\Flow\Log\SystemLoggerInterface::class);
     $this->cacheManager->injectSystemLogger($this->mockSystemLogger);
     $this->mockConfigurationManager = $this->getMockBuilder(\TYPO3\Flow\Configuration\ConfigurationManager::class)->disableOriginalConstructor()->getMock();
     $this->cacheManager->injectConfigurationManager($this->mockConfigurationManager);
 }
开发者ID:nlx-sascha,项目名称:flow-development-collection,代码行数:12,代码来源:CacheManagerTest.php

示例7: setCacheThrowsExceptionIfCachePathLengthExceedsMaximumPathLength

 /**
  * @test
  * @expectedException \TYPO3\Flow\Cache\Exception
  */
 public function setCacheThrowsExceptionIfCachePathLengthExceedsMaximumPathLength()
 {
     $this->mockEnvironment = $this->getMockBuilder('TYPO3\\Flow\\Utility\\Environment')->disableOriginalConstructor()->getMock();
     $this->mockEnvironment->expects($this->any())->method('getMaximumPathLength')->will($this->returnValue(5));
     $this->mockEnvironment->expects($this->any())->method('getPathToTemporaryDirectory')->will($this->returnValue('vfs://Temporary/Directory/'));
     $this->getSimpleFileBackend();
 }
开发者ID:sengkimlong,项目名称:Flow3-Authentification,代码行数:11,代码来源:SimpleFileBackendTest.php


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