Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
FrontendStorageConfigurationPoolTest.php
Go to the documentation of this file.
1 <?php
7 
11 
12 class FrontendStorageConfigurationPoolTest extends \PHPUnit\Framework\TestCase
13 {
15  protected $model;
16 
19 
23  private $defaultStorageConfiguration;
24 
25  protected function setUp()
26  {
27  $this->defaultStorageConfiguration = $this->createMock(FrontendStorageConfigurationInterface::class);
28  $productStorageConfiguration = $this->createMock(ProductInterface::class);
29  $this->objectManagerHelper = new ObjectManagerHelper($this);
30  $this->model = $this->objectManagerHelper->getObject(
31  \Magento\Catalog\Model\FrontendStorageConfigurationPool::class,
32  [
33  'storageConfigurations' => [
34  'default' => $this->defaultStorageConfiguration,
35  'product' => $productStorageConfiguration
36  ]
37  ]
38  );
39  }
40 
41  public function testGet()
42  {
43  $this->assertEquals($this->defaultStorageConfiguration, $this->model->get('default'));
44  }
45 
50  public function testGetWithException()
51  {
52  $this->assertEquals($this->defaultStorageConfiguration, $this->model->get('product'));
53  }
54 }