Пример #1
0
 public function testSkuPossuiObjetoStock()
 {
     $sku = new Sku();
     $sku->setStockQuantity(500);
     $this->assertJson($sku->toJson('stock'));
     $this->assertJsonStringEqualsJsonString('{"quantity":500}', $sku->toJson('stock'));
 }
Пример #2
0
 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));
     }
 }