_objectManager->get(FilterBuilder::class); $filters = [ $filterBuilder->setField(OrderInterface::INCREMENT_ID) ->setValue('100000001') ->create(), ]; /** @var SearchCriteriaBuilder $searchCriteriaBuilder */ $searchCriteriaBuilder = $this->_objectManager->get(SearchCriteriaBuilder::class); $searchCriteria = $searchCriteriaBuilder->addFilters($filters) ->create(); $this->orderRepository = $this->_objectManager->get(OrderRepositoryInterface::class); $orders = $this->orderRepository->getList($searchCriteria) ->getItems(); /** @var OrderInterface $order */ $this->order = array_pop($orders); $this->order->getPayment()->setMethod(Config::METHOD_PAYFLOWLINK); /** @var $quote \Magento\Quote\Model\Quote */ $quote = $this->_objectManager->create(Quote::class)->setStoreid($this->order->getStoreId()); $this->quoteRepository = $this->_objectManager->get(CartRepositoryInterface::class); $this->quoteRepository->save($quote); $this->order->setQuoteId($quote->getId()); $this->orderRepository->save($this->order); $session = $this->_objectManager->get(Session::class); $session->setLastRealOrderId($this->order->getRealOrderId())->setLastQuoteId($this->order->getQuoteId()); } public function testCancelPaymentActionIsContentGenerated() { $this->dispatch('paypal/payflow/cancelpayment'); $this->assertContains("goToSuccessPage = ''", $this->getResponse()->getBody()); } public function testReturnurlActionIsContentGenerated() { $checkoutHelper = $this->_objectManager->create(\Magento\Paypal\Helper\Checkout::class); $checkoutHelper->cancelCurrentOrder('test'); $this->dispatch('paypal/payflow/returnurl'); $this->assertContains("goToSuccessPage = ''", $this->getResponse()->getBody()); } public function testFormActionIsContentGenerated() { $this->dispatch('paypal/payflow/form'); $this->assertContains( '