1 | <?php |
||
13 | class DecoderTest extends \PHPUnit_Framework_TestCase |
||
14 | { |
||
15 | public function testDecodeShouldDoReturningObjectSubscription() |
||
16 | { |
||
17 | $detailsDate = new DateTime('2011-11-23T13:40:00.000-02:00'); |
||
18 | $detailsLastEventDate = new DateTime('2011-11-25T20:04:00.000-02:00'); |
||
19 | $detailsAddress = new Address('SP', 'SAO PAULO', '01421000', 'J Paulista', 'ALAMEDAITU', '78', 'ap.2601'); |
||
20 | $customer = new Customer('[email protected]', 'Nome Comprador', new Phone('11', '30389678'), $detailsAddress); |
||
21 | $details = new Details('C08984', 'REF1234', 'CANCELLED', $detailsDate, $detailsLastEventDate, $customer); |
||
22 | |||
23 | $subscription = new Subscription('Seguro Notebook', $details, '538C53', 'auto'); |
||
24 | |||
25 | $obj = simplexml_load_file(__DIR__.'/xml/preApproval.xml'); |
||
26 | |||
27 | $decoder = new Decoder; |
||
28 | $this->assertEquals($subscription, $decoder->decode($obj)); |
||
29 | } |
||
30 | } |
||
31 |