dataMock = $this->createMock(\Magento\Framework\Mview\Config\Data::class); $this->model = new Config( $this->dataMock ); } public function testGetViews() { $this->dataMock->expects($this->once()) ->method('get') ->will($this->returnValue(['some_data'])); $this->assertEquals(['some_data'], $this->model->getViews()); } public function testGetView() { $this->dataMock->expects($this->once()) ->method('get') ->with('some_view') ->will($this->returnValue(['some_data'])); $this->assertEquals(['some_data'], $this->model->getView('some_view')); } }