Index: tests/Zend/View/Helper/Navigation/_files/expected/menu/normalize-id-prefix-without-content.html =================================================================== --- tests/Zend/View/Helper/Navigation/_files/expected/menu/normalize-id-prefix-without-content.html (revision 0) +++ tests/Zend/View/Helper/Navigation/_files/expected/menu/normalize-id-prefix-without-content.html (revision 0) @@ -0,0 +1,16 @@ +
\ No newline at end of file Index: tests/Zend/View/Helper/Navigation/_files/expected/menu/normalize-id-prefix-with-content.html =================================================================== --- tests/Zend/View/Helper/Navigation/_files/expected/menu/normalize-id-prefix-with-content.html (revision 0) +++ tests/Zend/View/Helper/Navigation/_files/expected/menu/normalize-id-prefix-with-content.html (revision 0) @@ -0,0 +1,16 @@ + \ No newline at end of file Index: tests/Zend/View/Helper/Navigation/_files/expected/menu/normalize-id-prefix-with-null.html =================================================================== --- tests/Zend/View/Helper/Navigation/_files/expected/menu/normalize-id-prefix-with-null.html (revision 0) +++ tests/Zend/View/Helper/Navigation/_files/expected/menu/normalize-id-prefix-with-null.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 24859) +++ tests/Zend/View/Helper/Navigation/MenuTest.php (working copy) @@ -191,6 +191,83 @@ $this->assertEquals($expected, $this->_helper->render($this->_nav2)); } + /** + * @group ZF-10409 + */ + public function testSetPrefixForIdWithContent() + { + $this->_helper->setPrefixForId('test-'); + $expected = $this->_getExpected('menu/normalize-id-prefix-with-content.html'); + $this->assertEquals($expected, $this->_helper->render($this->_nav3)); + } + + /** + * @group ZF-10409 + */ + public function testSetPrefixForIdWithoutContent() + { + $this->_helper->setPrefixForId(''); + $expected = $this->_getExpected('menu/normalize-id-prefix-without-content.html'); + $this->assertEquals($expected, $this->_helper->render($this->_nav3)); + } + + /** + * @group ZF-10409 + */ + public function testSetPrefixForIdWithNull() + { + $this->_helper->setPrefixForId(null); + $expected = $this->_getExpected('menu/normalize-id-prefix-with-null.html'); + $this->assertEquals($expected, $this->_helper->render($this->_nav3)); + } + + /** + * @group ZF-10409 + */ + public function testGetPrefixForIdWithContent() + { + $this->_helper->setPrefixForId('test'); + $this->assertEquals('test', $this->_helper->getPrefixForId()); + } + + /** + * @group ZF-10409 + */ + public function testGetPrefixForIdWithoutContent() + { + $this->_helper->setPrefixForId(''); + $this->assertEquals('', $this->_helper->getPrefixForId()); + } + + /** + * @group ZF-10409 + */ + public function testGetPrefixForIdWithNull() + { + $this->_helper->setPrefixForId(null); + $this->assertEquals('menu-', $this->_helper->getPrefixForId()); + } + + /** + * @group ZF-10409 + */ + public function testSkipPrefixForIdTrue() + { + $this->_helper->skipPrefixForId(true); + $expected = $this->_getExpected('menu/normalize-id-prefix-without-content.html'); + $this->assertEquals($expected, $this->_helper->render($this->_nav3)); + } + + /** + * @group ZF-10409 + */ + public function testSkipPrefixForIdFalse() + { + $this->_helper->skipPrefixForId(false); + $expected = $this->_getExpected('menu/normalize-id-prefix-with-null.html'); + $this->assertEquals($expected, $this->_helper->render($this->_nav3)); + } + public function testTranslationUsingZendTranslate() { $translator = $this->_getTranslator(); @@ -268,14 +345,6 @@ } } - - - - - - - - public function testSetMaxDepth() { $this->_helper->setMaxDepth(1); @@ -566,4 +635,54 @@ $this->assertEquals($expected, $actual); } + + /** + * @group ZF-7212 + */ + public function testRenderingWithUlId() + { + $this->_helper->setUlId('foo'); + + $this->assertContains( + '