コード例 #1
0
 /**
  * @dataProvider dataGetData
  * @covers ::getData
  */
 public function testGetData($parameters, $expected, $expectedException)
 {
     $request = new CaptureRequest($this->getHttpClient(), $this->getHttpRequest());
     $request->initialize($parameters);
     if ($expectedException) {
         $this->setExpectedException('Omnipay\\Common\\Exception\\InvalidRequestException', $expectedException);
     }
     $this->assertEquals($expected, $request->getData());
 }
コード例 #2
0
 /**
  * @coversNothing
  */
 public function testCapture()
 {
     $this->setMockHttpResponse('AuthoriseCaptureSuccess.http');
     $request = new CaptureRequest($this->getHttpClient(), $this->getHttpRequest());
     $request->initialize(array('transactionReference' => '9HJ30098MP9464308', 'amount' => '3.00', 'currency' => 'USD'));
     $response = $request->send();
     $this->assertInstanceOf('Omnipay\\PaypalRest\\Message\\CaptureResponse', $response);
     $this->assertTrue($response->isSuccessful());
     $this->assertEquals('1D2800957K044141A', $response->getTransactionReference());
 }