/** * @return void */ public function testSetPriceForExistingProductAbstractShouldChangePrice() { $productAbstract = SpyProductAbstractQuery::create()->filterBySku(self::DUMMY_SKU_PRODUCT_ABSTRACT)->findOne(); $request = SpyPriceProductQuery::create()->filterBySpyProductAbstract($productAbstract)->find(); $this->assertEquals(0, count($request)); $this->deletePriceEntitiesAbstract($productAbstract); $transferPriceProduct = $this->setTransferPriceProductAbstract(self::DUMMY_SKU_PRODUCT_ABSTRACT, self::DUMMY_PRICE_TYPE_1); $this->priceFacade->createPriceForProduct($transferPriceProduct); $request = SpyPriceProductQuery::create()->filterBySpyProductAbstract($productAbstract)->findOne(); $transferPriceProduct->setPrice(self::DUMMY_NEW_PRICE_2); $transferPriceProduct->setIdPriceProduct($request->getIdPriceProduct()); $this->priceFacade->setPriceForProduct($transferPriceProduct); $request = SpyPriceProductQuery::create()->filterBySpyProductAbstract($productAbstract)->findOne(); $this->assertEquals(self::DUMMY_NEW_PRICE_2, $request->getPrice()); }
/** * @return void */ public function testGetPriceForProductConcrete() { $price = $this->priceFacade->getPriceBySku(self::DUMMY_SKU_PRODUCT_CONCRETE, self::DUMMY_PRICE_TYPE_2); $this->assertEquals(999, $price); }