public function testFullAddress()
 {
     $data = ['postalCode' => '06410000', 'street' => 'Rua da prata', 'number' => '55', 'complement' => '', 'district' => 'Jardim dos Camargos', 'city' => 'Barueri', 'state' => 'SP', 'country' => 'Brasil'];
     $o = new Address($data);
     $this->assertEquals($data, $o->toArray());
     $this->assertEquals($data['postalCode'], $o->getPostalCode());
     $this->assertEquals($data['street'], $o->getStreet());
     $this->assertEquals($data['number'], $o->getNumber());
     $this->assertEquals($data['complement'], $o->getComplement());
     $this->assertEquals($data['district'], $o->getDistrict());
     $this->assertEquals($data['city'], $o->getCity());
     $this->assertEquals($data['state'], $o->getState());
     $this->assertEquals($data['country'], $o->getCountry());
 }
示例#2
0
<?php

require_once __DIR__ . '/../../vendor/autoload.php';
use laravel\pagseguro\Address\Address;
$addressData = ['postalCode' => '06410000', 'street' => 'Rua da prata', 'number' => '55', 'complement' => '', 'district' => 'Jardim dos Camargos', 'city' => 'Barueri', 'state' => 'SP', 'country' => 'Brasil'];
$address = new Address($addressData);
echo sprintf('DATA: %s', implode(', ', array_filter($address->toArray())));