public function testClearAllSales() { // Store current promo statuses $promoList = ProductSaleElementsQuery::create()->filterByPromo(true)->select('Id')->find()->toArray(); $event = new SaleClearStatusEvent(); $saleAction = new Sale(); $saleAction->clearStatus($event); // Restore promo status ProductSaleElementsQuery::create()->filterById($promoList)->update(['Promo' => true]); }
public function testCheckSaleActivation() { $event = new SaleActiveStatusCheckEvent(); $event->setDispatcher($this->dispatcher); $saleAction = new Sale($this->getContainer()); $saleAction->checkSaleActivation($event); }