/** * @dataProvider dataGetData * @covers ::getData */ public function testGetData($parameters, $expected, $expectedException) { $request = new CreateCardRequest($this->getHttpClient(), $this->getHttpRequest()); $request->initialize($parameters); if ($expectedException) { $this->setExpectedException('Omnipay\\Common\\Exception\\InvalidRequestException', $expectedException); } $this->assertEquals($expected, $request->getData()); }
/** * @coversNothing */ public function testCreateCard() { $this->setMockHttpResponse('CreateCardSuccess.http'); $request = new CreateCardRequest($this->getHttpClient(), $this->getHttpRequest()); $request->initialize(array('card' => $this->getValidCard(), 'payerId' => 'testPayerId')); $response = $request->send(); $this->assertInstanceOf('Omnipay\\PaypalRest\\Message\\CreateCardResponse', $response); $this->assertTrue($response->isSuccessful()); $this->assertEquals('CARD-2F417848LC187391NKRABZXQ', $response->getTransactionReference()); }