/** * Assert that return request displayed in Returns grid: * - customer * - status (pending) * - orderID * * @param Rma $rma * @param RmaIndex $rmaIndex * @return void */ public function processAssert(Rma $rma, RmaIndex $rmaIndex) { /** @var Order $order*/ $order = $rma->getDataFieldConfig('order_id')['source']->getOrder(); /** @var Customer $customer */ $customer = $order->getDataFieldConfig('customer_id')['source']->getCustomer(); $orderId = $rma->getOrderId(); $filter = ['order_id_from' => $orderId, 'order_id_to' => $orderId, 'customer' => sprintf('%s %s', $customer->getFirstname(), $customer->getLastname()), 'status' => $rma->getStatus()]; $rmaIndex->open(); \PHPUnit_Framework_Assert::assertTrue($rmaIndex->getRmaGrid()->isRowVisible($filter), "Rma for order '{$orderId}' is absent in grid."); }
/** * Get rma id. * * @param Rma $rma * @return string */ protected function getRmaId(Rma $rma) { $orderId = $rma->getOrderId(); $filter = ['order_id_from' => $orderId, 'order_id_to' => $orderId]; $this->rmaIndex->getRmaGrid()->search($filter); $rowsData = $this->rmaIndex->getRmaGrid()->getRowsData(['rma_id' => '.="RMA #"']); return $rowsData[0]['rma_id']; }