17 $this->_model = $this->getMockForAbstractClass(
18 \
Magento\Theme\Block\Adminhtml\System\Design\Theme\Edit\AbstractTab::class,
20 $this->createMock(\
Magento\Backend\Block\Template\Context::class),
21 $this->createMock(\
Magento\Framework\Registry::class),
22 $this->createMock(\
Magento\Framework\Data\FormFactory::class),
23 $this->createMock(\
Magento\Framework\ObjectManagerInterface::class),
29 [
'_getCurrentTheme',
'getTabLabel']
41 $this->_model->expects($this->once())->method(
'getTabLabel')->will($this->returnValue(
$label));
42 $this->assertEquals(
$label, $this->_model->getTabTitle());
53 $themeMock = $this->createPartialMock(\
Magento\Theme\Model\Theme::class, [
'isVirtual',
'getId',
'__wakeup']);
54 $themeMock->expects($this->any())->method(
'isVirtual')->will($this->returnValue($isVirtual));
56 $themeMock->expects($this->any())->method(
'getId')->will($this->returnValue($themeId));
58 $this->_model->expects($this->any())->method(
'_getCurrentTheme')->will($this->returnValue($themeMock));
61 $this->assertTrue($this->_model->canShowTab());
63 $this->assertFalse($this->_model->canShowTab());
72 return [[
true, 1,
true], [
true, 0,
false], [
false, 1,
false]];
77 $this->assertFalse($this->_model->isHidden());
testCanShowTab($isVirtual, $themeId, $result)