public function testInvalidObject() { try { Shippo_Address::retrieve('invalid'); } catch (Shippo_InvalidRequestError $e) { $this->assertEqual(404, $e->getHttpStatus()); } }
public function testInvalidCredentials() { // $this->expectException(); Shippo::setApiKey('invalid'); try { $address = Shippo_Address::create(); } catch (Shippo_AuthenticationError $e) { $this->assertEqual(401, $e->getHttpStatus()); } }
public static function getDefaultAddress() { parent::setTestApiKey(); return Shippo_Address::create(array('object_purpose' => 'QUOTE', 'name' => 'John Smith', 'company' => 'Initech', 'street1' => 'Greene Rd.', 'street_no' => '6512', 'street2' => '', 'city' => 'Woodridge', 'state' => 'IL', 'zip' => '60517', 'country' => 'US', 'phone' => '123 353 2345', 'email' => '*****@*****.**', 'metadata' => 'Customer ID 234;234')); }