| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | public function testPayment() |
||
| 34 | { |
||
| 35 | $tx1 = "abcd"; |
||
| 36 | $payment = new Payment(); |
||
| 37 | $payment->addTransactions($tx1); |
||
| 38 | |||
| 39 | $ack = new PaymentACK(); |
||
| 40 | $this->assertFalse($ack->hasPayment()); |
||
| 41 | $ack->setPayment($payment); |
||
| 42 | $this->assertTrue($ack->hasPayment()); |
||
| 43 | |||
| 44 | $serialized = $ack->serialize(); |
||
| 45 | $p1 = new PaymentACK(); |
||
| 46 | $p1->parse($serialized); |
||
| 47 | |||
| 48 | $this->assertTrue($p1->hasPayment()); |
||
| 49 | $this->assertTrue($p1->getPayment()->hasTransactions()); |
||
| 50 | $this->assertEquals($tx1, $p1->getPayment()->getTransactions(0)); |
||
| 51 | |||
| 52 | $ack->clearPayment(); |
||
| 53 | $this->assertFalse($ack->hasPayment()); |
||
| 54 | } |
||
| 55 | } |
||
| 56 |