public function testSkuPossuiObjetoStock() { $sku = new Sku(); $sku->setStockQuantity(500); $this->assertJson($sku->toJson('stock')); $this->assertJsonStringEqualsJsonString('{"quantity":500}', $sku->toJson('stock')); }
public function testGerenciaAtualizacoes() { if (!$this->hasToken()) { return $this->markTestSkipped('API Token ausente'); } $manager = new Manager($this->factoryClient()); foreach ($this->dataProviderSkus() as $data) { $sku = new Sku($data); $sku->getPrice()->setSellPrice($sku->getPrice()->getSellPrice() - 0.01); $sku->setStockQuantity(rand(1, 8)); $this->assertTrue($manager->save($sku)); } }
public function saveStatus(Sku $sku) { return $this->execute($this->factoryMap('saveStatus', ['itemId' => $sku->getId()]), $sku->toJson('Status')); }
public function addSku(Product $product, Sku $sku) { return $this->execute($this->factoryMap('addSku', ['itemId' => $product->getId()]), $sku->toJson()); }
public function has(Sku\Sku $sku) { return $this->getSku()->hasId($sku->getId()); }