Ejemplo n.º 1
0
 /**
  * @covers \Magento\Paypal\Model\Hostedpro::initialize
  * @magentoDataFixture Magento/Paypal/_files/order_hostedpro.php
  */
 public function testInitialize()
 {
     /** @var \Magento\Sales\Model\Order $order */
     $order = $this->objectManager->create(Order::class);
     $order->loadByIncrementId('100000001');
     $payment = $order->getPayment();
     $this->model->setInfoInstance($payment);
     $this->api->expects(static::once())->method('call')->willReturn(['EMAILLINK' => 'https://securepayments.sandbox.paypal.com/webapps/HostedSoleSolutionApp/webflow/']);
     $state = $this->objectManager->create(DataObject::class);
     $this->model->initialize(Config::PAYMENT_ACTION_AUTH, $state);
     static::assertEquals(Order::STATE_PENDING_PAYMENT, $state->getState());
     static::assertEquals(Order::STATE_PENDING_PAYMENT, $state->getStatus());
     static::assertFalse($state->getIsNotified());
 }