public function testAddSingleExplicitNotVisibleZendNavigationPageMvc() { $page = new Zend_Navigation_Page_Mvc(array('label' => __('Browse Items'), 'controller' => 'items', 'action' => 'browse', 'visible' => false)); $this->assertNull($page->get('uid')); $this->_nav->addPage($page); $this->assertEquals(CURRENT_BASE_URL, PUBLIC_BASE_URL); $uid = PUBLIC_BASE_URL . '/items/browse'; // this page should not be altered because it should create a new Omeka_Zend_Navigation_Page_Mvc $this->assertNull($page->get('uid')); $this->assertEquals(1, $this->_nav->count()); $this->assertTrue($this->_nav->hasChildren()); $firstChild = $this->_nav->getChildren(); $this->assertNotEquals($page, $firstChild); $this->assertInstanceOf('Omeka_Navigation_Page_Mvc', $firstChild); $this->assertEquals(__('Browse Items'), $firstChild->getLabel()); $this->assertEquals('items', $firstChild->getController()); $this->assertEquals('browse', $firstChild->getAction()); $this->assertFalse($firstChild->getVisible()); $this->assertEquals(0, $firstChild->getOrder()); $this->assertEquals($uid, $firstChild->get('uid')); $this->assertEquals($uid, $firstChild->getHref()); $this->assertTrue($this->_nav->hasPages()); $pages = $this->_nav->getPages(); // it should convert the Zend_Navigation_Page_Mvc to an // Omeka_Navigation_Page_Mvc page $this->assertContainsOnly('Omeka_Navigation_Page_Mvc', $pages); $this->assertNotContains($page, $pages); $this->assertContains($firstChild, $pages); $foundPage = $this->_nav->findOneBy('uid', $uid); $this->assertNotEquals($page, $foundPage); $this->assertEquals($firstChild, $foundPage); $pageArray = $firstChild->toArray(); $this->assertContains($pageArray, $this->_nav->toArray()); }