Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AdaptStockResolverToAdminWebsiteTest.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
15 use PHPUnit\Framework\TestCase;
16 
18 {
22  private $stockResolver;
23 
27  private $defaultStockProvider;
28 
29  protected function setUp()
30  {
31  $this->stockResolver = Bootstrap::getObjectManager()->get(StockResolverInterface::class);
32  $this->defaultStockProvider = Bootstrap::getObjectManager()->get(DefaultStockProviderInterface::class);
33  }
34 
36  {
37  $defaultStockId = $this->defaultStockProvider->getId();
38  $currentStock = $this->stockResolver->execute(
41  );
42 
43  self::assertEquals($defaultStockId, $currentStock->getStockId());
44  }
45 }