/** * Check whether element is visible * * @return bool */ public function isVisible() { if (parent::isVisible()) { return $this->hasChildren() || $this->getFrontendModel(); } return false; }
/** * @param array $settings * @param string $scope * @dataProvider isVisibleReturnsFalseForNonProperScopesDataProvider */ public function testIsVisibleReturnsFalseForNonProperScopes($settings, $scope) { $this->_model->setData($settings, $scope); $this->assertFalse($this->_model->isVisible()); }
public function testIsVisibleReturnFalseIfModuleNotEnabled() { $this->moduleManagerMock->expects($this->once())->method('isOutputEnabled')->with('test_module')->willReturn(false); $this->_model->setData(['showInDefault' => 1, 'showInStore' => 0, 'showInWebsite' => 0, 'if_module_enabled' => 'test_module'], 'default'); $this->assertFalse($this->_model->isVisible()); }