Index: tests/Zend/View/Helper/Navigation/BreadcrumbsTest.php =================================================================== --- tests/Zend/View/Helper/Navigation/BreadcrumbsTest.php (revision 24695) +++ tests/Zend/View/Helper/Navigation/BreadcrumbsTest.php (working copy) @@ -251,4 +251,47 @@ $this->assertEquals($expected, $actual); } + + /** + * @group ZF-11876 + */ + public function testRenderingWithCustomHtmlAttribs() + { + $container = new Zend_Navigation(array( + array( + 'label' => 'Page 1', + 'uri' => 'p1', + 'customHtmlAttribs' => array( + 'rel' => 'nofollow', + 'style' => 'font-weight: bold;', + ), + 'pages' => array( + array( + 'label' => 'Page 2', + 'uri' => 'p2', + 'customHtmlAttribs' => array( + 'rel' => 'nofollow', + ), + 'pages' => array( + array( + 'label' => 'Page 3', + 'uri' => 'p3', + 'active' => true, + ), + ), + ), + ), + ), + )); + + $expected = 'Page 1' + . ' > ' + . 'Page 2' + . ' > ' + . 'Page 3'; + + $actual = $this->_helper->setMinDepth(0)->render($container); + + $this->assertEquals($expected, $actual); + } } Index: tests/Zend/View/Helper/Navigation/_files/expected/menu/customhtmlattribs.html =================================================================== --- tests/Zend/View/Helper/Navigation/_files/expected/menu/customhtmlattribs.html (revision 0) +++ tests/Zend/View/Helper/Navigation/_files/expected/menu/customhtmlattribs.html (revision 0) @@ -0,0 +1,16 @@ + \ No newline at end of file Index: tests/Zend/View/Helper/Navigation/MenuTest.php =================================================================== --- tests/Zend/View/Helper/Navigation/MenuTest.php (revision 24695) +++ tests/Zend/View/Helper/Navigation/MenuTest.php (working copy) @@ -540,4 +540,23 @@ $this->assertEquals($expected, $this->_helper->render($this->_nav3)); } + + /** + * @group ZF-11876 + */ + public function testRenderingWithCustomHtmlAttribs() + { + $this->_nav3->findOneBy('id', 'home')->setCustomHtmlAttrib('rel', 'nofollow'); + $this->_nav3->findOneBy('uri', 'contact')->setCustomHtmlAttribs( + array( + 'rel' => 'nofollow', + 'style' => 'font-weight: bold;', + ) + ); + $this->_nav3->findOneBy('id', 'imprint')->setCustomHtmlAttrib('rel', 'nofollow'); + + $expected = $this->_getExpected('menu/customhtmlattribs.html'); + + $this->assertEquals($expected, $this->_helper->render($this->_nav3)); + } }