/** * 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']; }
/** * Assert that displayed rma data on edit page equals passed from fixture. * * @param Rma $rma * @param RmaIndex $rmaIndex * @param RmaEdit $rmaEdit * @return void */ public function processAssert(Rma $rma, RmaIndex $rmaIndex, RmaEdit $rmaEdit) { $rmaIndex->open(); $rmaIndex->getRmaGrid()->searchAndOpen(['rma_id' => $rma->getEntityId()]); $fixtureData = $this->getRmaData($rma); $pageData = $rmaEdit->getRmaForm()->getData($rma); $this->verifyDetails($fixtureData, $pageData); $this->verifyComment($fixtureData, $pageData); $this->verifyItems($fixtureData, $pageData); }
/** * 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."); }