/**
  * @test
  */
 public function shouldReturnExpectedTokenIfAllCheckPassedOnVerify()
 {
     $_SERVER['REQUEST_URI'] = 'http://target.com/foo';
     $expectedToken = new Token();
     $expectedToken->setHash('theHash');
     $expectedToken->setTargetUrl('http://target.com/foo');
     $storageMock = $this->createStorageMock();
     $storageMock->expects($this->once())->method('findModelById')->with('theHash')->will($this->returnValue($expectedToken));
     $verifier = new PlainHttpRequestVerifier($storageMock);
     $actualToken = $verifier->verify(array('payum_token' => 'theHash'));
     $this->assertSame($expectedToken, $actualToken);
 }
Exemplo n.º 2
0
 /**
  * @test
  */
 public function shouldAllowGetPreviouslySetHash()
 {
     $token = new Token();
     $token->setHash('theToken');
     $this->assertSame('theToken', $token->getHash());
 }
Exemplo n.º 3
0
 /**
  * @test
  */
 public function shouldAllowSetHash()
 {
     $token = new \Payum\Model\Token();
     $token->setHash('foo');
 }