public function testIsActiveWithRecursiveTrueShouldReturnTrueIfChildActive() { $page = new Zend_Navigation_Page_Uri(array('label' => 'Page 1', 'active' => false, 'pages' => array(new Zend_Navigation_Page_Uri(array('label' => 'Page 1.1', 'active' => false, 'pages' => array(new Zend_Navigation_Page_Uri(array('label' => 'Page 1.1', 'active' => true)))))))); $this->assertFalse($page->isActive(false)); $this->assertTrue($page->isActive(true)); }
/** * Returns whether page should be considered active or not * * @param bool $recursive [optional] whether page should be considered * active if any child pages are active. Default is * false. * @return bool whether page should be considered active */ public function isActive($recursive = false) { $this->_active = is_current_url($this->getUri()); return parent::isActive($recursive); }