Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ConfigurationPoolTest.php
Go to the documentation of this file.
1 <?php
7 
8 class ConfigurationPoolTest extends \PHPUnit\Framework\TestCase
9 {
13  protected $instancesType;
14 
18  protected $model;
19 
20  protected function setUp()
21  {
22  $this->instancesType = ['simple' => 'simple', 'default' => 'default'];
23 
24  $objectManagerMock = $this->createMock(\Magento\Framework\ObjectManagerInterface::class);
25  $this->model = new \Magento\Catalog\Helper\Product\ConfigurationPool($objectManagerMock, $this->instancesType);
26  }
27 
33  public function testGetByProductType($productType, $expectedResult)
34  {
35  $this->assertEquals($expectedResult, $this->model->getByProductType($productType));
36  }
37 
41  public function getByProductTypeDataProvider()
42  {
43  return [
44  [
45  'productType' => 'simple',
46  'expectedResult' => 'simple'
47  ],
48  [
49  'productType' => 'custom',
50  'expectedResult' => 'default'
51  ],
52  ];
53  }
54 }