| 1 | <?php |
||
| 7 | class LinksTest extends TestCase |
||
| 8 | { |
||
| 9 | public function testGetLinkWithoutCheckout() |
||
| 10 | { |
||
| 11 | $this->sandbox_mock = self::MOCK; |
||
| 12 | $this->mockHttpSession($this->body_order); |
||
| 13 | $order = $this->createOrder()->create(); |
||
| 14 | $this->mockHttpSession($this->body_billet_pay); |
||
| 15 | $payment = $order->payments()->setBoleto(new \DateTime('today +1day'), 'http://dev.moip.com.br/images/logo-header-moip.png')->execute(); |
||
|
|
|||
| 16 | |||
| 17 | $this->assertEquals('https://checkout-sandbox.moip.com.br/boleto/PAY-XNVIBO5MIQ9S', $payment->getLinks()->getLink('payBoleto')); |
||
| 18 | } |
||
| 19 | |||
| 20 | public function testGetCheckoutLink() |
||
| 28 | |||
| 29 | public function testGetAllCheckoutLinks() |
||
| 36 | } |
||
| 37 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: