Bladeren bron

Merge r25238 to 1.12 release branch

git-svn-id: http://framework.zend.com/svn/framework/standard/branches/release-1.12@25239 44c647ce-9c0f-0410-b52a-842ac1e357ba
frosch 13 jaren geleden
bovenliggende
commit
0d2dd30991

+ 57 - 2
library/Zend/View/Helper/Navigation/HelperAbstract.php

@@ -72,6 +72,13 @@ abstract class Zend_View_Helper_Navigation_HelperAbstract
     protected $_indent = '';
 
     /**
+     * Whether HTML/XML output should be formatted
+     *
+     * @var bool
+     */
+    protected $_formatOutput = true;
+
+    /**
      * Prefix for IDs when they are normalized
      *
      * @var string|null
@@ -278,16 +285,64 @@ abstract class Zend_View_Helper_Navigation_HelperAbstract
     }
 
     /**
-     * Returns indentation
+     * Returns indentation (format output is respected)
      *
-     * @return string
+     * @return string   indentation string or an empty string
      */
     public function getIndent()
     {
+        if (false === $this->getFormatOutput()) {
+            return '';
+        }
+
         return $this->_indent;
     }
 
     /**
+     * Returns the EOL character (format output is respected)
+     *
+     * @see self::EOL
+     * @see getFormatOutput()
+     *
+     * @return string       standard EOL charater or an empty string
+     */
+    public function getEOL()
+    {
+        if (false === $this->getFormatOutput()) {
+            return '';
+        }
+
+        return self::EOL;
+    }
+
+    /**
+     * Sets whether HTML/XML output should be formatted
+     *
+     * @param  bool $formatOutput                   [optional] whether output
+     *                                              should be formatted. Default
+     *                                              is true.
+     *
+     * @return Zend_View_Helper_Navigation_Sitemap  fluent interface, returns
+     *                                              self
+     */
+    public function setFormatOutput($formatOutput = true)
+    {
+        $this->_formatOutput = (bool)$formatOutput;
+
+        return $this;
+    }
+
+    /**
+     * Returns whether HTML/XML output should be formatted
+     *
+     * @return bool  whether HTML/XML output should be formatted
+     */
+    public function getFormatOutput()
+    {
+        return $this->_formatOutput;
+    }
+
+    /**
      * Sets prefix for IDs when they are normalized
      *
      * @param   string $prefix                              Prefix for IDs

+ 1 - 1
library/Zend/View/Helper/Navigation/Links.php

@@ -769,7 +769,7 @@ class Zend_View_Helper_Navigation_Links
             foreach ($types as $relation => $pages) {
                 foreach ($pages as $page) {
                     if ($r = $this->renderLink($page, $attrib, $relation)) {
-                        $output .= $indent . $r . self::EOL;
+                        $output .= $indent . $r . $this->getEOL();
                     }
                 }
             }

+ 100 - 37
library/Zend/View/Helper/Navigation/Menu.php

@@ -106,6 +106,13 @@ class Zend_View_Helper_Navigation_Menu
      * @var bool
      */
     protected $_addPageClassToLi = false;
+
+    /**
+     * Inner indentation string
+     *
+     * @var string
+     */
+    protected $_innerIndent = '    ';
     
     /**
      * View helper entry point:
@@ -404,6 +411,38 @@ class Zend_View_Helper_Navigation_Menu
         return $this->_addPageClassToLi;
     }
 
+    /**
+     * Set the inner indentation string for using in {@link render()}, optionally
+     * a number of spaces to indent with
+     *
+     * @param  string|int $indent                          indentation string or
+     *                                                     number of spaces
+     * @return Zend_View_Helper_Navigation_HelperAbstract  fluent interface,
+     *                                                     returns self
+     */
+    public function setInnerIndent($indent)
+    {
+        $this->_innerIndent = $this->_getWhitespace($indent);
+
+        return $this;
+    }
+
+    /**
+     * Returns inner indentation (format output is respected)
+     *
+     * @see getFormatOutput()
+     *
+     * @return string       indentation string or an empty string
+     */
+    public function getInnerIndent()
+    {
+        if (false === $this->getFormatOutput()) {
+            return '';
+        }
+
+        return $this->_innerIndent;
+    }
+
     // Public methods:
 
     /**
@@ -474,6 +513,14 @@ class Zend_View_Helper_Navigation_Menu
             $options['indent'] = $this->getIndent();
         }
 
+        // Inner ident
+        if (isset($options['innerIndent'])) {
+            $options['innerIndent'] =
+                $this->_getWhitespace($options['innerIndent']);
+        } else {
+            $options['innerIndent'] = $this->getInnerIndent();
+        }
+
         // UL class
         if (isset($options['ulClass']) && $options['ulClass'] !== null) {
             $options['ulClass'] = (string) $options['ulClass'];
@@ -559,13 +606,14 @@ class Zend_View_Helper_Navigation_Menu
      * Renders the deepest active menu within [$minDepth, $maxDeth], (called
      * from {@link renderMenu()})
      *
-     * @param  Zend_Navigation_Container $container  container to render
-     * @param  string                    $ulClass    CSS class for first UL
-     * @param  string                    $indent     initial indentation
-     * @param  int|null                  $minDepth   minimum depth
-     * @param  int|null                  $maxDepth   maximum depth
-     * @param  string|null               $ulId       unique identifier (id) for
-     *                                               first UL
+     * @param  Zend_Navigation_Container $container     container to render
+     * @param  string                    $ulClass       CSS class for first UL
+     * @param  string                    $indent        initial indentation
+     * @param  string                    $innerIndent   inner indentation
+     * @param  int|null                  $minDepth      minimum depth
+     * @param  int|null                  $maxDepth      maximum depth
+     * @param  string|null               $ulId          unique identifier (id)
+     *                                                  for first UL
      * @param  bool                      $addPageClassToLi  adds CSS class from
      *                                                      page to li element
      * @param  string|null               $activeClass       CSS class for active
@@ -578,6 +626,7 @@ class Zend_View_Helper_Navigation_Menu
     protected function _renderDeepestMenu(Zend_Navigation_Container $container,
                                           $ulClass,
                                           $indent,
+                                          $innerIndent,
                                           $minDepth,
                                           $maxDepth,
                                           $ulId,
@@ -615,7 +664,7 @@ class Zend_View_Helper_Navigation_Menu
         $html = $indent . '<ul'
                         . $this->_htmlAttribs($attribs)
                         . '>'
-                        . self::EOL;
+                        . $this->getEOL();
 
         // Reset prefix for IDs
         $this->_skipPrefixForId = $skipValue;
@@ -637,9 +686,10 @@ class Zend_View_Helper_Navigation_Menu
                     array('class' => $subPage->getClass())
                 );
             }
-            $html .= $indent . '    <li' . $liClass . '>' . self::EOL;
-            $html .= $indent . '        ' . $this->htmlify($subPage) . self::EOL;
-            $html .= $indent . '    </li>' . self::EOL;
+            $html .= $indent . $innerIndent . '<li' . $liClass . '>' . $this->getEOL();
+            $html .= $indent . str_repeat($innerIndent, 2) . $this->htmlify($subPage)
+                                                           . $this->getEOL();
+            $html .= $indent . $innerIndent . '</li>' . $this->getEOL();
         }
 
         $html .= $indent . '</ul>';
@@ -650,16 +700,17 @@ class Zend_View_Helper_Navigation_Menu
     /**
      * Renders a normal menu (called from {@link renderMenu()})
      *
-     * @param  Zend_Navigation_Container $container   container to render
-     * @param  string                    $ulClass     CSS class for first UL
-     * @param  string                    $indent      initial indentation
-     * @param  int|null                  $minDepth    minimum depth
-     * @param  int|null                  $maxDepth    maximum depth
-     * @param  bool                      $onlyActive  render only active branch?
-     * @param  bool                      $expandSibs  render siblings of active
-     *                                                branch nodes?
-     * @param  string|null               $ulId        unique identifier (id) for
-     *                                                first UL
+     * @param  Zend_Navigation_Container $container     container to render
+     * @param  string                    $ulClass       CSS class for first UL
+     * @param  string                    $indent        initial indentation
+     * @param  string                    $innerIndent   inner indentation
+     * @param  int|null                  $minDepth      minimum depth
+     * @param  int|null                  $maxDepth      maximum depth
+     * @param  bool                      $onlyActive    render only active branch?
+     * @param  bool                      $expandSibs    render siblings of active
+     *                                                  branch nodes?
+     * @param  string|null               $ulId          unique identifier (id)
+     *                                                  for first UL
      * @param  bool                      $addPageClassToLi  adds CSS class from
      *                                                      page to li element
      * @param  string|null               $activeClass       CSS class for active
@@ -672,6 +723,7 @@ class Zend_View_Helper_Navigation_Menu
     protected function _renderMenu(Zend_Navigation_Container $container,
                                    $ulClass,
                                    $indent,
+                                   $innerIndent,
                                    $minDepth,
                                    $maxDepth,
                                    $onlyActive,
@@ -747,7 +799,7 @@ class Zend_View_Helper_Navigation_Menu
 
             // make sure indentation is correct
             $depth   -= $minDepth;
-            $myIndent = $indent . str_repeat('        ', $depth);
+            $myIndent = $indent . str_repeat($innerIndent, $depth * 2);
 
             if ($depth > $prevDepth) {
                 $attribs = array();
@@ -767,22 +819,22 @@ class Zend_View_Helper_Navigation_Menu
                 $html .= $myIndent . '<ul'
                                    . $this->_htmlAttribs($attribs)
                                    . '>'
-                                   . self::EOL;
+                                   . $this->getEOL();
 
                 // Reset prefix for IDs
                 $this->_skipPrefixForId = $skipValue;
             } else if ($prevDepth > $depth) {
                 // close li/ul tags until we're at current depth
                 for ($i = $prevDepth; $i > $depth; $i--) {
-                    $ind = $indent . str_repeat('        ', $i);
-                    $html .= $ind . '    </li>' . self::EOL;
-                    $html .= $ind . '</ul>' . self::EOL;
+                    $ind   = $indent . str_repeat($innerIndent, $i * 2);
+                    $html .= $ind . $innerIndent . '</li>' . $this->getEOL();
+                    $html .= $ind . '</ul>' . $this->getEOL();
                 }
                 // close previous li tag
-                $html .= $myIndent . '    </li>' . self::EOL;
+                $html .= $myIndent . $innerIndent . '</li>' . $this->getEOL();
             } else {
                 // close previous li tag
-                $html .= $myIndent . '    </li>' . self::EOL;
+                $html .= $myIndent . $innerIndent . '</li>' . $this->getEOL();
             }
 
             // render li tag and page
@@ -805,10 +857,12 @@ class Zend_View_Helper_Navigation_Menu
                 }
             }
 
-            $html .= $myIndent . '    <li'
+            $html .= $myIndent . $innerIndent . '<li'
                    . $this->_htmlAttribs(array('class' => implode(' ', $liClasses)))
-                   . '>' . self::EOL
-                   . $myIndent . '        ' . $this->htmlify($page) . self::EOL;
+                   . '>' . $this->getEOL()
+                   . $myIndent . str_repeat($innerIndent, 2)
+                   . $this->htmlify($page)
+                   . $this->getEOL();
 
             // store as previous depth for next iteration
             $prevDepth = $depth;
@@ -817,11 +871,11 @@ class Zend_View_Helper_Navigation_Menu
         if ($html) {
             // done iterating container; close open ul/li tags
             for ($i = $prevDepth+1; $i > 0; $i--) {
-                $myIndent = $indent . str_repeat('        ', $i-1);
-                $html .= $myIndent . '    </li>' . self::EOL
-                       . $myIndent . '</ul>' . self::EOL;
+                $myIndent = $indent . str_repeat($innerIndent . $innerIndent, $i - 1);
+                $html    .= $myIndent . $innerIndent . '</li>' . $this->getEOL()
+                         . $myIndent . '</ul>' . $this->getEOL();
             }
-            $html = rtrim($html, self::EOL);
+            $html = rtrim($html, $this->getEOL());
         }
 
         return $html;
@@ -859,6 +913,7 @@ class Zend_View_Helper_Navigation_Menu
                 $container,
                 $options['ulClass'],
                 $options['indent'],
+                $options['innerIndent'],
                 $options['minDepth'],
                 $options['maxDepth'],
                 $options['ulId'],
@@ -872,6 +927,7 @@ class Zend_View_Helper_Navigation_Menu
                 $container,
                 $options['ulClass'],
                 $options['indent'],
+                $options['innerIndent'],
                 $options['minDepth'],
                 $options['maxDepth'],
                 $options['onlyActiveBranch'],
@@ -919,16 +975,23 @@ class Zend_View_Helper_Navigation_Menu
      *                                               (id) use for UL element
      * @param  bool                      $addPageClassToLi  adds CSS class from
      *                                                      page to li element
-     * @return string                                rendered content
+     * @param  string|int                $innerIndent   [optional] inner
+     *                                                  indentation as a string
+     *                                                  or number of spaces.
+     *                                                  Default is to use the
+     *                                                  {@link getInnerIndent()}.
+     * @return string                                   rendered content
      */
     public function renderSubMenu(Zend_Navigation_Container $container = null,
                                   $ulClass = null,
                                   $indent = null,
                                   $ulId   = null,
-                                  $addPageClassToLi = false)
+                                  $addPageClassToLi = false,
+                                  $innerIndent = null)
     {
         return $this->renderMenu($container, array(
             'indent'           => $indent,
+            'innerIndent'      => $innerIndent,
             'ulClass'          => $ulClass,
             'minDepth'         => null,
             'maxDepth'         => null,

+ 1 - 33
library/Zend/View/Helper/Navigation/Sitemap.php

@@ -54,13 +54,6 @@ class Zend_View_Helper_Navigation_Sitemap
     const SITEMAP_XSD = 'http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd';
 
     /**
-     * Whether XML output should be formatted
-     *
-     * @var bool
-     */
-    protected $_formatOutput = false;
-
-    /**
      * Whether the XML declaration should be included in XML output
      *
      * @var bool
@@ -109,31 +102,6 @@ class Zend_View_Helper_Navigation_Sitemap
     // Accessors:
 
     /**
-     * Sets whether XML output should be formatted
-     *
-     * @param  bool $formatOutput                   [optional] whether output
-     *                                              should be formatted. Default
-     *                                              is true.
-     * @return Zend_View_Helper_Navigation_Sitemap  fluent interface, returns
-     *                                              self
-     */
-    public function setFormatOutput($formatOutput = true)
-    {
-        $this->_formatOutput = (bool) $formatOutput;
-        return $this;
-    }
-
-    /**
-     * Returns whether XML output should be formatted
-     *
-     * @return bool  whether XML output should be formatted
-     */
-    public function getFormatOutput()
-    {
-        return $this->_formatOutput;
-    }
-
-    /**
      * Sets whether the XML declaration should be used in output
      *
      * @param  bool $useXmlDecl                     whether XML delcaration
@@ -471,6 +439,6 @@ class Zend_View_Helper_Navigation_Sitemap
                $dom->saveXML() :
                $dom->saveXML($dom->documentElement);
 
-        return rtrim($xml, PHP_EOL);
+        return rtrim($xml, self::EOL);
     }
 }

+ 22 - 0
tests/Zend/View/Helper/Navigation/LinksTest.php

@@ -713,4 +713,26 @@ class Zend_View_Helper_Navigation_LinksTest
 
         $this->assertEquals($expected, $actual);
     }
+
+    /**
+     * @group ZF-8874
+     */
+    public function testRenderingWithoutWhitespace()
+    {
+        $active = $this->_helper->findOneByLabel('Page 1.1');
+        $newFlag = Zend_View_Helper_Navigation_Links::RENDER_NEXT |
+                   Zend_View_Helper_Navigation_Links::RENDER_PREV;
+        $this->_helper->setRenderFlag($newFlag);
+        $this->_helper->setIndent('  ');
+        $active->active = true;
+
+        $this->_helper->setFormatOutput(false);
+
+        // build expected and actual result
+        $expected = '<link rel="next" href="page2" title="Page 2">'
+                  . '<link rel="prev" href="page1" title="Page 1">';
+        $actual = $this->_helper->render();
+
+        $this->assertEquals($expected, $actual);
+    }
 }

+ 58 - 0
tests/Zend/View/Helper/Navigation/MenuTest.php

@@ -908,4 +908,62 @@ class Zend_View_Helper_Navigation_MenuTest
 
         $this->assertEquals($expected, $actual);
     }
+
+    /**
+     * @group ZF-8874
+     */
+    public function testSetAndGetInnerIndent()
+    {
+        // Test standard
+        $this->assertSame('    ', $this->_helper->getInnerIndent());
+
+        // Test with format output true
+        $this->_helper->setInnerIndent(0);
+        $this->assertSame('', $this->_helper->getInnerIndent());
+
+        $this->_helper->setInnerIndent('        ');
+        $this->assertSame('        ', $this->_helper->getInnerIndent());
+
+        // Test with format output false
+        $this->_helper->setFormatOutput(false);
+        $this->assertSame('', $this->_helper->getInnerIndent());
+    }
+
+    /**
+     * @group ZF-8874
+     */
+    public function testRenderingWithoutWhitespace()
+    {
+        $this->_helper->setFormatOutput(false);
+
+        $expected = $this->_getExpected('menu/without_whitespace.html');
+
+        $this->assertEquals($expected, $this->_helper->render($this->_nav1));
+    }
+
+    /**
+     * @group ZF-8874
+     */
+    public function testRenderingWithInnerIndent()
+    {
+        $this->_helper->setIndent(4);
+
+        // Inner indent = 0
+        $this->_helper->setInnerIndent(0);
+        $expected = $this->_getExpected('menu/innerindent0.html');
+
+        $this->assertEquals($expected, $this->_helper->render($this->_nav1));
+
+        // Inner indent = 4
+        $this->_helper->setInnerIndent(4);
+        $expected = $this->_getExpected('menu/innerindent4.html');
+
+        $this->assertEquals($expected, $this->_helper->render($this->_nav1));
+
+        // Inner indent = 8
+        $this->_helper->setInnerIndent(8);
+        $expected = $this->_getExpected('menu/innerindent8.html');
+
+        $this->assertEquals($expected, $this->_helper->render($this->_nav1));
+    }
 }

+ 14 - 0
tests/Zend/View/Helper/Navigation/SitemapTest.php

@@ -300,4 +300,18 @@ class Zend_View_Helper_Navigation_SitemapTest
 
         $this->fail('A Zend_View_Exception was not thrown when using Schema validation');
     }
+
+    /**
+     * @group ZF-8874
+     */
+    public function testRenderingWithoutWhitespace()
+    {
+        // Reset format output option
+        $this->_helper->setFormatOutput(false);
+
+        $expected = $this->_helper->render();
+        $actual   = $this->_getExpected('sitemap/without_whitespace.xml');
+
+        $this->assertEquals($expected, $actual);
+    }
 }

+ 1 - 5
tests/Zend/View/Helper/Navigation/TestAbstract.php

@@ -146,11 +146,7 @@ abstract class Zend_View_Helper_Navigation_TestAbstract
      */
     protected function _getExpected($file)
     {
-        return str_replace(
-            "\n",
-            PHP_EOL,
-            file_get_contents($this->_files . '/expected/' . $file)
-        );        
+        return file_get_contents($this->_files . '/expected/' . $file);
     }
 
     /**

+ 81 - 0
tests/Zend/View/Helper/Navigation/_files/expected/menu/innerindent0.html

@@ -0,0 +1,81 @@
+    <ul class="navigation">
+    <li>
+    <a title="Go home" href="index">Home</a>
+    </li>
+    <li>
+    <a href="page1">Page 1</a>
+    <ul>
+    <li>
+    <a href="page1/page1_1">Page 1.1</a>
+    </li>
+    </ul>
+    </li>
+    <li class="active">
+    <a href="page2">Page 2</a>
+    <ul>
+    <li>
+    <a href="page2/page2_1">Page 2.1</a>
+    </li>
+    <li class="active">
+    <a href="page2/page2_2">Page 2.2</a>
+    <ul>
+    <li>
+    <a href="page2/page2_2/page2_2_1">Page 2.2.1</a>
+    </li>
+    <li class="active">
+    <a href="page2/page2_2/page2_2_2">Page 2.2.2</a>
+    </li>
+    </ul>
+    </li>
+    <li class="active">
+    <a href="page2/page2_3">Page 2.3</a>
+    <ul>
+    <li>
+    <a href="page2/page2_3/page2_3_1">Page 2.3.1</a>
+    </li>
+    <li class="active">
+    <a href="page2/page2_3/page2_3_3">Page 2.3.3</a>
+    <ul>
+    <li class="active">
+    <a href="page2/page2_3/page2_3_3/1">Page 2.3.3.1</a>
+    </li>
+    <li class="active">
+    <a href="page2/page2_3/page2_3_3/2">Page 2.3.3.2</a>
+    </li>
+    </ul>
+    </li>
+    </ul>
+    </li>
+    </ul>
+    </li>
+    <li>
+    <a href="page3">Page 3</a>
+    <ul>
+    <li>
+    <a href="page3/page3_1">Page 3.1</a>
+    </li>
+    <li>
+    <a href="page3/page3_2">Page 3.2</a>
+    <ul>
+    <li>
+    <a href="page3/page3_2/page3_2_1">Page 3.2.1</a>
+    </li>
+    <li>
+    <a href="page3/page3_2/page3_2_2">Page 3.2.2</a>
+    </li>
+    </ul>
+    </li>
+    <li>
+    <a href="page3/page3_3">Page 3.3</a>
+    <ul>
+    <li>
+    <a href="page3/page3_3/page3_3_2">Page 3.3.2</a>
+    </li>
+    </ul>
+    </li>
+    </ul>
+    </li>
+    <li>
+    <a href="http://www.zym-project.com/">Zym</a>
+    </li>
+    </ul>

+ 81 - 0
tests/Zend/View/Helper/Navigation/_files/expected/menu/innerindent4.html

@@ -0,0 +1,81 @@
+    <ul class="navigation">
+        <li>
+            <a title="Go home" href="index">Home</a>
+        </li>
+        <li>
+            <a href="page1">Page 1</a>
+            <ul>
+                <li>
+                    <a href="page1/page1_1">Page 1.1</a>
+                </li>
+            </ul>
+        </li>
+        <li class="active">
+            <a href="page2">Page 2</a>
+            <ul>
+                <li>
+                    <a href="page2/page2_1">Page 2.1</a>
+                </li>
+                <li class="active">
+                    <a href="page2/page2_2">Page 2.2</a>
+                    <ul>
+                        <li>
+                            <a href="page2/page2_2/page2_2_1">Page 2.2.1</a>
+                        </li>
+                        <li class="active">
+                            <a href="page2/page2_2/page2_2_2">Page 2.2.2</a>
+                        </li>
+                    </ul>
+                </li>
+                <li class="active">
+                    <a href="page2/page2_3">Page 2.3</a>
+                    <ul>
+                        <li>
+                            <a href="page2/page2_3/page2_3_1">Page 2.3.1</a>
+                        </li>
+                        <li class="active">
+                            <a href="page2/page2_3/page2_3_3">Page 2.3.3</a>
+                            <ul>
+                                <li class="active">
+                                    <a href="page2/page2_3/page2_3_3/1">Page 2.3.3.1</a>
+                                </li>
+                                <li class="active">
+                                    <a href="page2/page2_3/page2_3_3/2">Page 2.3.3.2</a>
+                                </li>
+                            </ul>
+                        </li>
+                    </ul>
+                </li>
+            </ul>
+        </li>
+        <li>
+            <a href="page3">Page 3</a>
+            <ul>
+                <li>
+                    <a href="page3/page3_1">Page 3.1</a>
+                </li>
+                <li>
+                    <a href="page3/page3_2">Page 3.2</a>
+                    <ul>
+                        <li>
+                            <a href="page3/page3_2/page3_2_1">Page 3.2.1</a>
+                        </li>
+                        <li>
+                            <a href="page3/page3_2/page3_2_2">Page 3.2.2</a>
+                        </li>
+                    </ul>
+                </li>
+                <li>
+                    <a href="page3/page3_3">Page 3.3</a>
+                    <ul>
+                        <li>
+                            <a href="page3/page3_3/page3_3_2">Page 3.3.2</a>
+                        </li>
+                    </ul>
+                </li>
+            </ul>
+        </li>
+        <li>
+            <a href="http://www.zym-project.com/">Zym</a>
+        </li>
+    </ul>

+ 81 - 0
tests/Zend/View/Helper/Navigation/_files/expected/menu/innerindent8.html

@@ -0,0 +1,81 @@
+    <ul class="navigation">
+            <li>
+                    <a title="Go home" href="index">Home</a>
+            </li>
+            <li>
+                    <a href="page1">Page 1</a>
+                    <ul>
+                            <li>
+                                    <a href="page1/page1_1">Page 1.1</a>
+                            </li>
+                    </ul>
+            </li>
+            <li class="active">
+                    <a href="page2">Page 2</a>
+                    <ul>
+                            <li>
+                                    <a href="page2/page2_1">Page 2.1</a>
+                            </li>
+                            <li class="active">
+                                    <a href="page2/page2_2">Page 2.2</a>
+                                    <ul>
+                                            <li>
+                                                    <a href="page2/page2_2/page2_2_1">Page 2.2.1</a>
+                                            </li>
+                                            <li class="active">
+                                                    <a href="page2/page2_2/page2_2_2">Page 2.2.2</a>
+                                            </li>
+                                    </ul>
+                            </li>
+                            <li class="active">
+                                    <a href="page2/page2_3">Page 2.3</a>
+                                    <ul>
+                                            <li>
+                                                    <a href="page2/page2_3/page2_3_1">Page 2.3.1</a>
+                                            </li>
+                                            <li class="active">
+                                                    <a href="page2/page2_3/page2_3_3">Page 2.3.3</a>
+                                                    <ul>
+                                                            <li class="active">
+                                                                    <a href="page2/page2_3/page2_3_3/1">Page 2.3.3.1</a>
+                                                            </li>
+                                                            <li class="active">
+                                                                    <a href="page2/page2_3/page2_3_3/2">Page 2.3.3.2</a>
+                                                            </li>
+                                                    </ul>
+                                            </li>
+                                    </ul>
+                            </li>
+                    </ul>
+            </li>
+            <li>
+                    <a href="page3">Page 3</a>
+                    <ul>
+                            <li>
+                                    <a href="page3/page3_1">Page 3.1</a>
+                            </li>
+                            <li>
+                                    <a href="page3/page3_2">Page 3.2</a>
+                                    <ul>
+                                            <li>
+                                                    <a href="page3/page3_2/page3_2_1">Page 3.2.1</a>
+                                            </li>
+                                            <li>
+                                                    <a href="page3/page3_2/page3_2_2">Page 3.2.2</a>
+                                            </li>
+                                    </ul>
+                            </li>
+                            <li>
+                                    <a href="page3/page3_3">Page 3.3</a>
+                                    <ul>
+                                            <li>
+                                                    <a href="page3/page3_3/page3_3_2">Page 3.3.2</a>
+                                            </li>
+                                    </ul>
+                            </li>
+                    </ul>
+            </li>
+            <li>
+                    <a href="http://www.zym-project.com/">Zym</a>
+            </li>
+    </ul>

+ 1 - 0
tests/Zend/View/Helper/Navigation/_files/expected/menu/without_whitespace.html

@@ -0,0 +1 @@
+<ul class="navigation"><li><a title="Go home" href="index">Home</a></li><li><a href="page1">Page 1</a><ul><li><a href="page1/page1_1">Page 1.1</a></li></ul></li><li class="active"><a href="page2">Page 2</a><ul><li><a href="page2/page2_1">Page 2.1</a></li><li class="active"><a href="page2/page2_2">Page 2.2</a><ul><li><a href="page2/page2_2/page2_2_1">Page 2.2.1</a></li><li class="active"><a href="page2/page2_2/page2_2_2">Page 2.2.2</a></li></ul></li><li class="active"><a href="page2/page2_3">Page 2.3</a><ul><li><a href="page2/page2_3/page2_3_1">Page 2.3.1</a></li><li class="active"><a href="page2/page2_3/page2_3_3">Page 2.3.3</a><ul><li class="active"><a href="page2/page2_3/page2_3_3/1">Page 2.3.3.1</a></li><li class="active"><a href="page2/page2_3/page2_3_3/2">Page 2.3.3.2</a></li></ul></li></ul></li></ul></li><li><a href="page3">Page 3</a><ul><li><a href="page3/page3_1">Page 3.1</a></li><li><a href="page3/page3_2">Page 3.2</a><ul><li><a href="page3/page3_2/page3_2_1">Page 3.2.1</a></li><li><a href="page3/page3_2/page3_2_2">Page 3.2.2</a></li></ul></li><li><a href="page3/page3_3">Page 3.3</a><ul><li><a href="page3/page3_3/page3_3_2">Page 3.3.2</a></li></ul></li></ul></li><li><a href="http://www.zym-project.com/">Zym</a></li></ul>

+ 2 - 0
tests/Zend/View/Helper/Navigation/_files/expected/sitemap/without_whitespace.xml

@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url><loc>http://localhost/index</loc></url><url><loc>http://localhost/page1</loc></url><url><loc>http://localhost/page1/page1_1</loc></url><url><loc>http://localhost/page2</loc></url><url><loc>http://localhost/page2/page2_1</loc></url><url><loc>http://localhost/page2/page2_2</loc></url><url><loc>http://localhost/page2/page2_2/page2_2_1</loc></url><url><loc>http://localhost/page2/page2_2/page2_2_2</loc></url><url><loc>http://localhost/page2/page2_3</loc></url><url><loc>http://localhost/page2/page2_3/page2_3_1</loc></url><url><loc>http://localhost/page2/page2_3/page2_3_3</loc></url><url><loc>http://localhost/page2/page2_3/page2_3_3/1</loc></url><url><loc>http://localhost/page2/page2_3/page2_3_3/2</loc></url><url><loc>http://localhost/page3</loc></url><url><loc>http://localhost/page3/page3_1</loc></url><url><loc>http://localhost/page3/page3_2</loc></url><url><loc>http://localhost/page3/page3_2/page3_2_1</loc></url><url><loc>http://localhost/page3/page3_2/page3_2_2</loc></url><url><loc>http://localhost/page3/page3_3</loc></url><url><loc>http://localhost/page3/page3_3/page3_3_2</loc></url><url><loc>http://www.zym-project.com/</loc></url></urlset>