| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace Ogone\Tests\FlexCheckout; |
||
| 17 | public function testCheckoutUrl() |
||
| 18 | { |
||
| 19 | $sha = new FakeShaComposer; |
||
| 20 | |||
| 21 | $flex = new FlexCheckoutPaymentRequest($sha); |
||
| 22 | $alias = new Alias("test111"); |
||
| 23 | $uri = "http://www.example.com"; |
||
| 24 | |||
| 25 | $flex->setPspId($this->configuration['psp_id']); |
||
| 26 | $flex->setAliasId($alias); |
||
| 27 | $flex->setOrderId("test20111"); |
||
| 28 | $flex->setPaymentMethod("CreditCard"); |
||
| 29 | $flex->setAccepturl($uri); |
||
| 30 | $flex->setExceptionurl($uri); |
||
| 31 | $flex->setShaSign(); |
||
| 32 | $flex->validate(); |
||
| 33 | |||
| 34 | $url = $flex->getCheckoutUrl(); |
||
| 35 | |||
| 36 | $this->assertEquals($url, |
||
| 37 | "https://ogone.test.v-psp.com/Tokenization/HostedPage?ACCOUNT.PSPID=0d8ufu089ad&ALIAS.ALIASID=test111&ALIAS.ORDERID=test20111&CARD.PAYMENTMETHOD=CreditCard&PARAMETERS.ACCEPTURL=http%3A%2F%2Fwww.example.com&PARAMETERS.EXCEPTIONURL=http%3A%2F%2Fwww.example.com&SHASIGNATURE.SHASIGN=foo"); |
||
| 38 | } |
||
| 39 | } |
||
| 51 |
Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.