From 4c01d7c9b31a16ce594a716bc1121c7652457c1c Mon Sep 17 00:00:00 2001 From: Dennis Hendrickx Date: Fri, 10 Jun 2016 13:23:28 +0200 Subject: [PATCH] Purchase request unit test get data improved --- tests/Message/PurchaseRequestTest.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/Message/PurchaseRequestTest.php b/tests/Message/PurchaseRequestTest.php index e7b4fc4..448064f 100644 --- a/tests/Message/PurchaseRequestTest.php +++ b/tests/Message/PurchaseRequestTest.php @@ -26,8 +26,30 @@ public function setUp() public function testGetData() { + $this->request->initialize(array( + 'websiteKey' => 'web', + 'secretKey' => 'secret', + 'amount' => '12.00', + 'currency' => 'EUR', + 'testMode' => true, + 'transactionId' => 13, + 'returnUrl' => 'https://www.example.com/return', + 'cancelUrl' => 'https://www.example.com/cancel', + 'culture' => 'nl-NL', + 'paymentMethod' => 'mastercard', + 'issuer' => 'RABONL2U', + )); + $data = $this->request->getData(); + $this->assertSame('web', $data['Brq_websitekey']); + $this->assertSame('12.00', $data['Brq_amount']); + $this->assertSame('EUR', $data['Brq_currency']); + $this->assertSame(13, $data['Brq_invoicenumber']); + $this->assertSame('https://www.example.com/return', $data['Brq_return']); + $this->assertSame('https://www.example.com/cancel', $data['Brq_returncancel']); + $this->assertSame('nl-NL', $data['Brq_culture']); + $this->assertNotContains('Brq_payment_method', $data); $this->assertNotContains('Brq_service_ideal_issuer', $data); $this->assertNotContains('Brq_requestedservices', $data);