Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
MaskedQuoteIdToQuoteIdTest.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
10 use Magento\TestFramework\Helper\Bootstrap as BootstrapHelper;
12 
13 class MaskedQuoteIdToQuoteIdTest extends \PHPUnit\Framework\TestCase
14 {
18  private $maskedQuoteIdToQuoteId;
19 
23  private $guestCartManagement;
24 
25  protected function setUp()
26  {
27  $objectManager = BootstrapHelper::getObjectManager();
28  $this->maskedQuoteIdToQuoteId = $objectManager->create(MaskedQuoteIdToQuoteIdInterface::class);
29  $this->guestCartManagement = $objectManager->create(GuestCartManagementInterface::class);
30  }
31 
32  public function testMaskedIdToQuoteId()
33  {
34  $maskedQuoteId = $this->guestCartManagement->createEmptyCart();
35  $quoteId = $this->maskedQuoteIdToQuoteId->execute($maskedQuoteId);
36 
37  self::assertGreaterThan(0, $quoteId);
38  }
39 
41  {
42  self::expectException(\Magento\Framework\Exception\NoSuchEntityException::class);
43 
44  $this->maskedQuoteIdToQuoteId->execute('test');
45  }
46 }
$objectManager
Definition: bootstrap.php:17