ReviewTest.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Test class for \Magento\Paypal\Block\Express\Review
  8. */
  9. namespace Magento\Paypal\Block\Express;
  10. class ReviewTest extends \PHPUnit\Framework\TestCase
  11. {
  12. /**
  13. * @magentoDataFixture Magento/Sales/_files/quote.php
  14. */
  15. public function testRenderAddress()
  16. {
  17. $quote = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Quote\Model\Quote::class);
  18. $quote->load('test01', 'reserved_order_id');
  19. $block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
  20. \Magento\Framework\View\LayoutInterface::class
  21. )->createBlock(
  22. \Magento\Paypal\Block\Express\Review::class
  23. );
  24. $addressData = include __DIR__ . '/../../../Sales/_files/address_data.php';
  25. $address = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
  26. \Magento\Quote\Model\Quote\Address::class,
  27. ['data' => $addressData]
  28. );
  29. $address->setAddressType('billing');
  30. $address->setQuote($quote);
  31. $this->assertContains('Los Angeles', $block->renderAddress($address));
  32. }
  33. }