/** * Search order products report. * * @param OrderInjectable $order * @param array $customersReport * @return void */ public function test(OrderInjectable $order, array $customersReport) { // Preconditions $order->persist(); // Steps $this->orderedProducts->open(); $this->orderedProducts->getGridBlock()->searchAccounts($customersReport); }
/** * Assert product name and qty in Ordered Products report * * @param OrderedProductsReport $orderedProducts * @param OrderInjectable $order * @return void */ public function processAssert(OrderedProductsReport $orderedProducts, OrderInjectable $order) { $products = $order->getEntityId()['products']; $totalQuantity = $orderedProducts->getGridBlock()->getOrdersResults($order); $productQty = []; foreach ($totalQuantity as $key => $value) { /** @var CatalogProductSimple $product */ $product = $products[$key]; $productQty[$key] = $product->getCheckoutData()['qty']; } \PHPUnit_Framework_Assert::assertEquals($totalQuantity, $productQty); }