本文整理汇总了PHP中TYPO3\Flow\Aop\JoinPointInterface::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP JoinPointInterface::expects方法的具体用法?PHP JoinPointInterface::expects怎么用?PHP JoinPointInterface::expects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\Flow\Aop\JoinPointInterface
的用法示例。
在下文中一共展示了JoinPointInterface::expects方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateUuidGeneratesUuidAndRegistersProxyAsNewObject
/**
* @test
* @return void
*/
public function generateUuidGeneratesUuidAndRegistersProxyAsNewObject()
{
$className = 'Class' . md5(uniqid(mt_rand(), TRUE));
eval('class ' . $className . ' implements \\TYPO3\\Flow\\Persistence\\Aspect\\PersistenceMagicInterface { public $Persistence_Object_Identifier = NULL; }');
$object = new $className();
$this->mockJoinPoint->expects($this->atLeastOnce())->method('getProxy')->will($this->returnValue($object));
$this->mockPersistenceManager->expects($this->atLeastOnce())->method('registerNewObject')->with($object);
$this->persistenceMagicAspect->generateUuid($this->mockJoinPoint);
$this->assertEquals(36, strlen($object->Persistence_Object_Identifier));
}
示例2: enforcePolicyDoesNotInvokeInterceptorIfAuthorizationChecksAreDisabled
/**
* @test
* @todo adjust when AfterInvocationInterceptor is used again
*/
public function enforcePolicyDoesNotInvokeInterceptorIfAuthorizationChecksAreDisabled()
{
$this->mockAdviceChain->expects($this->once())->method('proceed')->with($this->mockJoinPoint);
$this->mockJoinPoint->expects($this->once())->method('getAdviceChain')->will($this->returnValue($this->mockAdviceChain));
$this->mockSecurityContext->expects($this->atLeastOnce())->method('areAuthorizationChecksDisabled')->will($this->returnValue(true));
$this->mockPolicyEnforcementInterceptor->expects($this->never())->method('invoke');
$this->policyEnforcementAspect->enforcePolicy($this->mockJoinPoint);
}
示例3: generateValueHashUsesTimestampOfDateTime
/**
* @test
*/
public function generateValueHashUsesTimestampOfDateTime()
{
$date = new \DateTime();
$methodArguments = array('foo' => new \DateTime());
$className = 'Class' . md5(uniqid(mt_rand(), TRUE));
eval('class ' . $className . ' { }');
$object = new $className();
$this->mockJoinPoint->expects($this->atLeastOnce())->method('getProxy')->will($this->returnValue($object));
$this->mockJoinPoint->expects($this->atLeastOnce())->method('getMethodArguments')->will($this->returnValue($methodArguments));
$this->persistenceMagicAspect->generateValueHash($this->mockJoinPoint);
$this->assertEquals(sha1($className . $date->getTimestamp()), $object->Persistence_Object_Identifier);
}