public function __construct($uspsUserID, Address $address) { $this->setUspsUserID($uspsUserID); $this->setAddress1($address->getAddress1()); $this->setAddress2($address->getAddress2()); $this->setCity($address->getCity()); $this->setState($address->getState()); $this->setZip5($address->getZip5()); $this->setZip4($address->getZip4()); }
/** * Test ::VerifyAddress * @todo Test exception handling */ public function testVerifyAddress() { $client = $this->taxcloud; $uspsUserID = '123ABCDE5678'; $address = new Address('1600 Pennsylvania Ave NW', '', 'Washington', 'DC', '20500', '0003'); $verifyAddress = new VerifyAddress($uspsUserID, $address); $this->assertEquals($uspsUserID, $verifyAddress->getUspsUserID()); $resultobj = new VerifiedAddress(); $result = new ReflectionClass('\\TaxCloud\\VerifiedAddress'); $property = $result->getProperty('Address1'); $property->setAccessible(true); $property->setValue($resultobj, $address->getAddress1()); $property = $result->getProperty('City'); $property->setAccessible(true); $property->setValue($resultobj, $address->getCity()); $property = $result->getProperty('State'); $property->setAccessible(true); $property->setValue($resultobj, $address->getState()); $property = $result->getProperty('Zip5'); $property->setAccessible(true); $property->setValue($resultobj, $address->getZip5()); $property = $result->getProperty('Zip4'); $property->setAccessible(true); $property->setValue($resultobj, $address->getZip4()); $property = $result->getProperty('ErrNumber'); $property->setAccessible(true); $property->setValue($resultobj, '0'); $expected = new ReflectionClass('\\TaxCloud\\VerifyAddressResponse'); $expectedobj = new VerifyAddressResponse(); $property = $expected->getProperty('VerifyAddressResult'); $property->setAccessible(true); $property->setValue($expectedobj, $resultobj); $this->soapmock->expects($this->any())->method('__soapCall')->with('VerifyAddress')->will($this->returnValue($expectedobj)); $client->setSoapClient($this->soapmock); $this->assertEquals($address, $client->VerifyAddress($verifyAddress)); }
/** * @covers \TaxCloud\Address::getZip */ public function testGetZip() { $zip = $this->object->getZip(); $this->assertEquals('20006-0004', $zip, 'getZip() should return ZIP+4'); }