本文整理匯總了PHP中TYPO3\CMS\Core\Tests\AccessibleObjectInterface::validateToken方法的典型用法代碼示例。如果您正苦於以下問題:PHP AccessibleObjectInterface::validateToken方法的具體用法?PHP AccessibleObjectInterface::validateToken怎麽用?PHP AccessibleObjectInterface::validateToken使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TYPO3\CMS\Core\Tests\AccessibleObjectInterface
的用法示例。
在下文中一共展示了AccessibleObjectInterface::validateToken方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: tokenFromSessionDataIsAvailableForValidateToken
/**
* @test
*/
public function tokenFromSessionDataIsAvailableForValidateToken()
{
$sessionToken = '881ffea2159ac72182557b79dc0c723f5a8d20136f9fab56cdd4f8b3a1dbcfcd';
$formName = 'foo';
$action = 'edit';
$formInstanceName = '42';
$tokenId = \TYPO3\CMS\Core\Utility\GeneralUtility::hmac($formName . $action . $formInstanceName . $sessionToken);
$_SESSION['installToolFormToken'] = $sessionToken;
$this->fixture->_call('retrieveSessionToken');
$this->assertTrue($this->fixture->validateToken($tokenId, $formName, $action, $formInstanceName));
}
示例2: tokenFromSessionDataIsAvailableForValidateToken
/**
* @test
*/
public function tokenFromSessionDataIsAvailableForValidateToken()
{
$sessionToken = '881ffea2159ac72182557b79dc0c723f5a8d20136f9fab56cdd4f8b3a1dbcfcd';
$formName = 'foo';
$action = 'edit';
$formInstanceName = '42';
$tokenId = \TYPO3\CMS\Core\Utility\GeneralUtility::hmac($formName . $action . $formInstanceName . $sessionToken);
$this->getBackendUser()->expects($this->atLeastOnce())->method('getSessionData')->with('formSessionToken')->will($this->returnValue($sessionToken));
$this->subject->_call('retrieveSessionToken');
$this->assertTrue($this->subject->validateToken($tokenId, $formName, $action, $formInstanceName));
}
示例3: failingTokenValidationInvokesFailingTokenClosure
/**
* @test
* @expectedException \Exception
* @expectedExceptionCode 1442592030
*/
public function failingTokenValidationInvokesFailingTokenClosure()
{
$this->subject->validateToken('foo', 'bar');
}