Example #1
0
 /**
  * Test of getEndpoint method for the  Inventory endpoint if Sandbox mode on
  *
  * @return void
  **/
 public function testGetUrlFromEndpointInventoryIfSandboxModeOn()
 {
     $this->configuration->setup(['sandboxMode' => true]);
     $endpoint = $this->configuration->getEndpoint(Configuration::ENDPOINT_INVENTORY);
     $expected = 'http://sandbox-api.buscape.com.br/product/t1/inventory';
     $this->assertEquals($expected, $endpoint->getUrl($this->configuration));
 }
Example #2
0
 /**
  * Inventory Update
  *
  * @param ProductCollection $products
  *
  * @return Response
  */
 public function inventoryUpdate(ProductCollection $products)
 {
     $endpoint = $this->configuration->getEndpoint(Configuration::ENDPOINT_INVENTORY);
     $request = new Request($endpoint, $products, $this->configuration, $this->getLogger());
     $response = new Response();
     $response->mergeData($products, $request->send());
     return $response;
 }
Example #3
0
 /**
  * Test of Request
  *
  * @return void
  **/
 public function testRequest()
 {
     $endpoint = $this->configuration->getEndpoint(Configuration::ENDPOINT_COLLECTION);
     $collection = $this->getCollection();
     $request = new Request($endpoint, $collection, $this->configuration);
     $response = $request->send();
     $expected = $this->getRequestExpected($collection, $endpoint->chunk);
     $this->assertEquals($expected, $response);
 }