public function testExecuteInternal() { $this->viewMock->expects($this->once())->method('getPage')->willReturn($this->pageMock); $this->pageMock->expects($this->once())->method('getConfig')->willReturn($this->pageConfigMock); $this->pageConfigMock->expects($this->once())->method('getTitle')->willReturn($this->pageTitleMock); $this->pageTitleMock->expects($this->once())->method('prepend')->willReturnSelf(); $this->assertNull($this->object->executeInternal()); }
protected function generateImageConfig() { $themeMock = $this->getMock('\\Magento\\Theme\\Model\\Theme', [], [], '', false); $themesArrayMock = [$themeMock]; $this->themeCollectionMock->expects($this->any())->method('loadRegisteredThemes')->willReturn($themesArrayMock); $configMock = $this->getMock('\\Magento\\Framework\\Config\\View', [], [], '', false); $this->viewConfigMock->expects($this->atLeastOnce())->method('getViewConfig')->willReturn($configMock); $imageConfig = ['swatch_image' => ['width' => 30, 'height' => 20], 'swatch_thumb' => ['width' => 110, 'height' => 90]]; $configMock->expects($this->any())->method('getMediaEntities')->willReturn($imageConfig); }
/** * @dataProvider dataForVideoBackground */ public function testGetVideoAutoRestartAttribute($expectedResult) { $this->viewConfigMock->expects($this->once())->method('getMediaAttributes')->willReturn($expectedResult); $this->mediaHelperObject->getVideoAutoRestartAttribute(); }