public function testGetTheme() { $themeKey = 'theme'; $themePath = 'path'; $this->registrar->expects($this->once())->method('getPath')->with(ComponentRegistrar::THEME, $themeKey)->willReturn($themePath); $themePackage = $this->getMock('\\Magento\\Framework\\View\\Design\\Theme\\ThemePackage', [], [], '', false); $this->factory->expects($this->once())->method('create')->with($themeKey, $themePath)->willReturn($themePackage); $this->assertSame($themePackage, $this->object->getTheme($themeKey)); }