/** * @param Collect $collect * * @return bool */ public function remove(Collect $collect) { if (null == $collect->getId()) { throw new \ErrorException('Can not remove a non existent Collect !'); } else { $request = new DeleteJson($this->removeUrl($collect)); } $deleted = $request->makeRequest(); return (bool) $deleted; }
public function testCreateAndRemoveANewCollect() { $collect = new Collect(); $collect->setCollectionId(23136625)->setProductId(299068065)->setFeatured(false); // Create a new Product in the store $collect = $this->exporter->export($collect); $this->assertNotNull($collect->getId()); $this->assertFalse($collect->isFeatured()); // API Call limit usleep(50000); // Delete the Collect. $deleted = $this->exporter->remove($collect); $this->assertTrue($deleted); }