本文整理汇总了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();
}
示例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));
}
示例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);
}
示例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));
}
示例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));
}
示例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);
}
示例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();
}