Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ConfigTest.php
Go to the documentation of this file.
1 <?php
8 
9 use \Magento\Framework\Mview\Config;
10 
11 class ConfigTest extends \PHPUnit\Framework\TestCase
12 {
16  protected $model;
17 
21  protected $dataMock;
22 
23  protected function setUp()
24  {
25  $this->dataMock = $this->createMock(\Magento\Framework\Mview\Config\Data::class);
26  $this->model = new Config(
27  $this->dataMock
28  );
29  }
30 
31  public function testGetViews()
32  {
33  $this->dataMock->expects($this->once())
34  ->method('get')
35  ->will($this->returnValue(['some_data']));
36  $this->assertEquals(['some_data'], $this->model->getViews());
37  }
38 
39  public function testGetView()
40  {
41  $this->dataMock->expects($this->once())
42  ->method('get')
43  ->with('some_view')
44  ->will($this->returnValue(['some_data']));
45  $this->assertEquals(['some_data'], $this->model->getView('some_view'));
46  }
47 }