public function testGetResourceReturnsSpecifiedType()
 {
     $this->connection->expects($this->once())->method('get')->with('http://storeurl' . $this->basePath . '/whatever', false)->will($this->returnValue(array(array())));
     Client::configure(array('store_url' => 'http://storeurl', 'username' => 'whatever', 'api_key' => 'whatever'));
     Client::setConnection($this->connection);
     // re-set the connection since Client::configure unsets it
     $resource = Client::getResource('/whatever');
     $this->assertInstanceOf('Bigcommerce\\Api\\Resource', $resource);
 }
 public function option()
 {
     return Client::getResource($this->fields->option->resource, 'Option');
 }
 public function tax_class()
 {
     return Client::getResource($this->fields->tax_class->resource, 'TaxClass');
 }
 public function option()
 {
     return Client::getResource('/options/' . $this->fields->option_id, 'Option');
 }
Exemplo n.º 5
0
 public static function getCountryState($country_id, $id)
 {
     return Bigcommerce::getResource('/countries/' . $country_id . '/states/' . $id);
 }