コード例 #1
0
 /**
  * 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);
 }
コード例 #2
0
 /**
  * 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.");
 }
コード例 #3
0
 /**
  * Run test create Rma Entity.
  *
  * @param Rma $rma
  * @param RmaIndex $rmaIndex
  * @param AssertRmaSuccessSaveMessage $assertRmaSuccessSaveMessage
  * @return array
  */
 public function test(Rma $rma, RmaIndex $rmaIndex, AssertRmaSuccessSaveMessage $assertRmaSuccessSaveMessage)
 {
     // Preconditions
     /** @var Order $order */
     $order = $rma->getDataFieldConfig('order_id')['source']->getOrder();
     $this->objectManager->create('Mage\\Sales\\Test\\TestStep\\CreateInvoiceStep', ['order' => $order])->run();
     $this->objectManager->create('Mage\\Shipping\\Test\\TestStep\\CreateShipmentStep', ['order' => $order])->run();
     // Steps
     $this->rmaIndex->open();
     $this->rmaIndex->getGridPageActions()->addNew();
     $this->rmaChooseOrder->getOrderGrid()->searchAndOpen(['id' => $rma->getOrderId()]);
     $this->rmaNew->getRmaForm()->fill($rma);
     $this->rmaNew->getPageActions()->save();
     $assertRmaSuccessSaveMessage->processAssert($rmaIndex);
     $rma = $this->createRma($rma, $this->getRmaId($rma));
     return ['rma' => $rma];
 }