Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
GetSkusByProductIdsTest.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
12 use PHPUnit\Framework\TestCase;
13 
14 class GetSkusByProductIdsTest extends TestCase
15 {
19  private $getSkusByProductIds;
20 
21  protected function setUp()
22  {
23  parent::setUp();
24 
25  $this->getSkusByProductIds = Bootstrap::getObjectManager()->get(GetSkusByProductIdsInterface::class);
26  }
27 
31  public function testExecute()
32  {
33  $skuById = [101 => 'search_product_1', 102 => 'search_product_2', 103 => 'search_product_3'];
34 
35  self::assertEquals($skuById, $this->getSkusByProductIds->execute(array_keys($skuById)));
36  }
37 
44  public function testExecuteWithNotExistedIds()
45  {
46  $ids = [998, 999, 102];
47 
48  $this->getSkusByProductIds->execute($ids);
49  }
50 }