Skip to content

Commit

Permalink
Add test for locale
Browse files Browse the repository at this point in the history
  • Loading branch information
Willem Stuursma committed May 19, 2015
1 parent f2aa80c commit c633e0d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/apiUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,22 @@ public function testGetPaymentsWorksCorrectly ()
$this->assertEquals("https://www.mollie.nl/payscreen/pay/d0b0E3EA3v", $payment->getPaymentUrl());
$this->assertNull($payment->metadata);
}

public function testMethodsWorksCorrectly ()
{
$this->api->expects($this->once())
->method("performHttpCall")
->with(Mollie_API_Client::HTTP_GET, "methods?offset=0&count=0&locale=de")
->will($this->returnValue('{"totalCount":4,"offset":0,"count":4,"data":[{"id":"sofort","description":"SOFORT \u00dcberweisung","amount":{"minimum":"0.31","maximum":"5000.00"},"image":{"normal":"https://www.mollie.com/images/payscreen/methods/sofort.png","bigger":"https://www.mollie.com/images/payscreen/methods/[email protected]"}},{"id":"ideal","description":"iDEAL","amount":{"minimum":"0.55","maximum":"50000.00"},"image":{"normal":"https://www.mollie.com/images/payscreen/methods/ideal.png","bigger":"https://www.mollie.com/images/payscreen/methods/[email protected]"}},{"id":"mistercash","description":"Bancontact/Mister Cash","amount":{"minimum":"0.31","maximum":"10000.00"},"image":{"normal":"https://www.mollie.com/images/payscreen/methods/mistercash.png","bigger":"https://www.mollie.com/images/payscreen/methods/[email protected]"}},{"id":"belfius","description":"Belfius Direct Net","amount":{"minimum":"0.31","maximum":"50000.00"},"image":{"normal":"https://www.mollie.com/images/payscreen/methods/belfius.png","bigger":"https://www.mollie.com/images/payscreen/methods/[email protected]"}}]}'));

$methods = $this->api->methods->all(0, 0, array("locale" => "de"));

$this->assertCount(4, $methods);
$this->assertInstanceOf("Mollie_API_Object_List", $methods);

foreach ($methods as $method)
{
$this->assertInstanceof("Mollie_API_Object_Method", $method);
}
}
}

0 comments on commit c633e0d

Please sign in to comment.