| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738 |
- <?php
- /**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category Zend
- * @package Zend_View
- * @subpackage UnitTests
- * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
- require_once dirname(__FILE__) . '/TestAbstract.php';
- require_once 'Zend/View/Helper/Navigation/Links.php';
- /**
- * Tests Zend_View_Helper_Navigation_Links
- *
- * @category Zend
- * @package Zend_View
- * @subpackage UnitTests
- * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @group Zend_View
- * @group Zend_View_Helper
- */
- class Zend_View_Helper_Navigation_LinksTest
- extends Zend_View_Helper_Navigation_TestAbstract
- {
- /**
- * Class name for view helper to test
- *
- * @var string
- */
- protected $_helperName = 'Zend_View_Helper_Navigation_Links';
- /**
- * View helper
- *
- * @var Zend_View_Helper_Navigation_Links
- */
- protected $_helper;
- private $_doctypeHelper;
- private $_oldDoctype;
- public function setUp()
- {
- parent::setUp();
- // doctype fix (someone forgot to clean up after their unit tests)
- $this->_doctypeHelper = $this->_helper->view->doctype();
- $this->_oldDoctype = $this->_doctypeHelper->getDoctype();
- $this->_doctypeHelper->setDoctype(
- Zend_View_Helper_Doctype::HTML4_LOOSE);
- // disable all active pages
- foreach ($this->_helper->findAllByActive(true) as $page) {
- $page->active = false;
- }
- }
- public function tearDown()
- {
- $this->_doctypeHelper->setDoctype($this->_oldDoctype);
- }
- public function testHelperEntryPointWithoutAnyParams()
- {
- $returned = $this->_helper->links();
- $this->assertEquals($this->_helper, $returned);
- $this->assertEquals($this->_nav1, $returned->getContainer());
- }
- public function testHelperEntryPointWithContainerParam()
- {
- $returned = $this->_helper->links($this->_nav2);
- $this->assertEquals($this->_helper, $returned);
- $this->assertEquals($this->_nav2, $returned->getContainer());
- }
- public function testDoNotRenderIfNoPageIsActive()
- {
- $this->assertEquals('', $this->_helper->render());
- }
- public function testDetectRelationFromStringPropertyOfActivePage()
- {
- $active = $this->_helper->findOneByLabel('Page 2');
- $active->addRel('example', 'http://www.example.com/');
- $found = $this->_helper->findRelation($active, 'rel', 'example');
- $expected = array(
- 'type' => 'Zend_Navigation_Page_Uri',
- 'href' => 'http://www.example.com/',
- 'label' => null
- );
- $actual = array(
- 'type' => get_class($found),
- 'href' => $found->getHref(),
- 'label' => $found->getLabel()
- );
- $this->assertEquals($expected, $actual);
- }
- public function testDetectRelationFromPageInstancePropertyOfActivePage()
- {
- $active = $this->_helper->findOneByLabel('Page 2');
- $active->addRel('example', Zend_Navigation_Page::factory(array(
- 'uri' => 'http://www.example.com/',
- 'label' => 'An example page'
- )));
- $found = $this->_helper->findRelExample($active);
- $expected = array(
- 'type' => 'Zend_Navigation_Page_Uri',
- 'href' => 'http://www.example.com/',
- 'label' => 'An example page'
- );
- $actual = array(
- 'type' => get_class($found),
- 'href' => $found->getHref(),
- 'label' => $found->getLabel()
- );
- $this->assertEquals($expected, $actual);
- }
- public function testDetectRelationFromArrayPropertyOfActivePage()
- {
- $active = $this->_helper->findOneByLabel('Page 2');
- $active->addRel('example', array(
- 'uri' => 'http://www.example.com/',
- 'label' => 'An example page'
- ));
- $found = $this->_helper->findRelExample($active);
- $expected = array(
- 'type' => 'Zend_Navigation_Page_Uri',
- 'href' => 'http://www.example.com/',
- 'label' => 'An example page'
- );
- $actual = array(
- 'type' => get_class($found),
- 'href' => $found->getHref(),
- 'label' => $found->getLabel()
- );
- $this->assertEquals($expected, $actual);
- }
- public function testDetectRelationFromConfigInstancePropertyOfActivePage()
- {
- $active = $this->_helper->findOneByLabel('Page 2');
- $active->addRel('example', new Zend_Config(array(
- 'uri' => 'http://www.example.com/',
- 'label' => 'An example page'
- )));
- $found = $this->_helper->findRelExample($active);
- $expected = array(
- 'type' => 'Zend_Navigation_Page_Uri',
- 'href' => 'http://www.example.com/',
- 'label' => 'An example page'
- );
- $actual = array(
- 'type' => get_class($found),
- 'href' => $found->getHref(),
- 'label' => $found->getLabel()
- );
- $this->assertEquals($expected, $actual);
- }
- public function testDetectMultipleRelationsFromArrayPropertyOfActivePage()
- {
- $active = $this->_helper->findOneByLabel('Page 2');
- $active->addRel('alternate', array(
- array(
- 'label' => 'foo',
- 'uri' => 'bar'
- ),
- array(
- 'label' => 'baz',
- 'uri' => 'bat'
- )
- ));
- $found = $this->_helper->findRelAlternate($active);
- $expected = array('type' => 'array', 'count' => 2);
- $actual = array('type' => gettype($found), 'count' => count($found));
- $this->assertEquals($expected, $actual);
- }
- public function testDetectMultipleRelationsFromConfigPropertyOfActivePage()
- {
- $active = $this->_helper->findOneByLabel('Page 2');
- $active->addRel('alternate', new Zend_Config(array(
- array(
- 'label' => 'foo',
- 'uri' => 'bar'
- ),
- array(
- 'label' => 'baz',
- 'uri' => 'bat'
- )
- )));
- $found = $this->_helper->findRelAlternate($active);
- $expected = array('type' => 'array', 'count' => 2);
- $actual = array('type' => gettype($found), 'count' => count($found));
- $this->assertEquals($expected, $actual);
- }
- public function testExtractingRelationsFromPageProperties()
- {
- $types = array(
- 'alternate', 'stylesheet', 'start', 'next', 'prev', 'contents',
- 'index', 'glossary', 'copyright', 'chapter', 'section', 'subsection',
- 'appendix', 'help', 'bookmark'
- );
- $samplePage = Zend_Navigation_Page::factory(array(
- 'label' => 'An example page',
- 'uri' => 'http://www.example.com/'
- ));
- $active = $this->_helper->findOneByLabel('Page 2');
- $expected = array();
- $actual = array();
- foreach ($types as $type) {
- $active->addRel($type, $samplePage);
- $found = $this->_helper->findRelation($active, 'rel', $type);
- $expected[$type] = $samplePage->getLabel();
- $actual[$type] = $found->getLabel();
- $active->removeRel($type);
- }
- $this->assertEquals($expected, $actual);
- }
- public function testFindStartPageByTraversal()
- {
- $active = $this->_helper->findOneByLabel('Page 2.1');
- $expected = 'Home';
- $actual = $this->_helper->findRelStart($active)->getLabel();
- $this->assertEquals($expected, $actual);
- }
- public function testDoNotFindStartWhenGivenPageIsTheFirstPage()
- {
- $active = $this->_helper->findOneByLabel('Home');
- $actual = $this->_helper->findRelStart($active);
- $this->assertNull($actual, 'Should not find any start page');
- }
- public function testFindNextPageByTraversalShouldFindChildPage()
- {
- $active = $this->_helper->findOneByLabel('Page 2');
- $expected = 'Page 2.1';
- $actual = $this->_helper->findRelNext($active)->getLabel();
- $this->assertEquals($expected, $actual);
- }
- public function testFindNextPageByTraversalShouldFindSiblingPage()
- {
- $active = $this->_helper->findOneByLabel('Page 2.1');
- $expected = 'Page 2.2';
- $actual = $this->_helper->findRelNext($active)->getLabel();
- $this->assertEquals($expected, $actual);
- }
- public function testFindNextPageByTraversalShouldWrap()
- {
- $active = $this->_helper->findOneByLabel('Page 2.2.2');
- $expected = 'Page 2.3';
- $actual = $this->_helper->findRelNext($active)->getLabel();
- $this->assertEquals($expected, $actual);
- }
- public function testFindPrevPageByTraversalShouldFindParentPage()
- {
- $active = $this->_helper->findOneByLabel('Page 2.1');
- $expected = 'Page 2';
- $actual = $this->_helper->findRelPrev($active)->getLabel();
- $this->assertEquals($expected, $actual);
- }
- public function testFindPrevPageByTraversalShouldFindSiblingPage()
- {
- $active = $this->_helper->findOneByLabel('Page 2.2');
- $expected = 'Page 2.1';
- $actual = $this->_helper->findRelPrev($active)->getLabel();
- $this->assertEquals($expected, $actual);
- }
- public function testFindPrevPageByTraversalShouldWrap()
- {
- $active = $this->_helper->findOneByLabel('Page 2.3');
- $expected = 'Page 2.2.2';
- $actual = $this->_helper->findRelPrev($active)->getLabel();
- $this->assertEquals($expected, $actual);
- }
- public function testShouldFindChaptersFromFirstLevelOfPagesInContainer()
- {
- $active = $this->_helper->findOneByLabel('Page 2.3');
- $found = $this->_helper->findRelChapter($active);
- $expected = array('Page 1', 'Page 2', 'Page 3', 'Zym');
- $actual = array();
- foreach ($found as $page) {
- $actual[] = $page->getLabel();
- }
- $this->assertEquals($expected, $actual);
- }
- public function testFindingChaptersShouldExcludeSelfIfChapter()
- {
- $active = $this->_helper->findOneByLabel('Page 2');
- $found = $this->_helper->findRelChapter($active);
- $expected = array('Page 1', 'Page 3', 'Zym');
- $actual = array();
- foreach ($found as $page) {
- $actual[] = $page->getLabel();
- }
- $this->assertEquals($expected, $actual);
- }
- public function testFindSectionsWhenActiveChapterPage()
- {
- $active = $this->_helper->findOneByLabel('Page 2');
- $found = $this->_helper->findRelSection($active);
- $expected = array('Page 2.1', 'Page 2.2', 'Page 2.3');
- $actual = array();
- foreach ($found as $page) {
- $actual[] = $page->getLabel();
- }
- $this->assertEquals($expected, $actual);
- }
- public function testDoNotFindSectionsWhenActivePageIsASection()
- {
- $active = $this->_helper->findOneByLabel('Page 2.2');
- $found = $this->_helper->findRelSection($active);
- $this->assertNull($found);
- }
- public function testDoNotFindSectionsWhenActivePageIsASubsection()
- {
- $active = $this->_helper->findOneByLabel('Page 2.2.1');
- $found = $this->_helper->findRelation($active, 'rel', 'section');
- $this->assertNull($found);
- }
- public function testFindSubsectionWhenActivePageIsSection()
- {
- $active = $this->_helper->findOneByLabel('Page 2.2');
- $found = $this->_helper->findRelSubsection($active);
- $expected = array('Page 2.2.1', 'Page 2.2.2');
- $actual = array();
- foreach ($found as $page) {
- $actual[] = $page->getLabel();
- }
- $this->assertEquals($expected, $actual);
- }
- public function testDoNotFindSubsectionsWhenActivePageIsASubSubsection()
- {
- $active = $this->_helper->findOneByLabel('Page 2.2.1');
- $found = $this->_helper->findRelSubsection($active);
- $this->assertNull($found);
- }
- public function testDoNotFindSubsectionsWhenActivePageIsAChapter()
- {
- $active = $this->_helper->findOneByLabel('Page 2');
- $found = $this->_helper->findRelSubsection($active);
- $this->assertNull($found);
- }
- public function testFindRevSectionWhenPageIsSection()
- {
- $active = $this->_helper->findOneByLabel('Page 2.2');
- $found = $this->_helper->findRevSection($active);
- $this->assertEquals('Page 2', $found->getLabel());
- }
- public function testFindRevSubsectionWhenPageIsSubsection()
- {
- $active = $this->_helper->findOneByLabel('Page 2.2.1');
- $found = $this->_helper->findRevSubsection($active);
- $this->assertEquals('Page 2.2', $found->getLabel());
- }
- public function testAclFiltersAwayPagesFromPageProperty()
- {
- $acl = new Zend_Acl();
- $acl->addRole(new Zend_Acl_Role('member'));
- $acl->addRole(new Zend_Acl_Role('admin'));
- $acl->add(new Zend_Acl_Resource('protected'));
- $acl->allow('admin', 'protected');
- $this->_helper->setAcl($acl);
- $this->_helper->setRole($acl->getRole('member'));
- $samplePage = Zend_Navigation_Page::factory(array(
- 'label' => 'An example page',
- 'uri' => 'http://www.example.com/',
- 'resource' => 'protected'
- ));
- $active = $this->_helper->findOneByLabel('Home');
- $expected = array(
- 'alternate' => false,
- 'stylesheet' => false,
- 'start' => false,
- 'next' => 'Page 1',
- 'prev' => false,
- 'contents' => false,
- 'index' => false,
- 'glossary' => false,
- 'copyright' => false,
- 'chapter' => 'array(4)',
- 'section' => false,
- 'subsection' => false,
- 'appendix' => false,
- 'help' => false,
- 'bookmark' => false
- );
- $actual = array();
- foreach ($expected as $type => $discard) {
- $active->addRel($type, $samplePage);
- $found = $this->_helper->findRelation($active, 'rel', $type);
- if (null === $found) {
- $actual[$type] = false;
- } elseif (is_array($found)) {
- $actual[$type] = 'array(' . count($found) . ')';
- } else {
- $actual[$type] = $found->getLabel();
- }
- }
- $this->assertEquals($expected, $actual);
- }
- public function testAclFiltersAwayPagesFromContainerSearch()
- {
- $acl = new Zend_Acl();
- $acl->addRole(new Zend_Acl_Role('member'));
- $acl->addRole(new Zend_Acl_Role('admin'));
- $acl->add(new Zend_Acl_Resource('protected'));
- $acl->allow('admin', 'protected');
- $this->_helper->setAcl($acl);
- $this->_helper->setRole($acl->getRole('member'));
- $oldContainer = $this->_helper->getContainer();
- $container = $this->_helper->getContainer();
- $iterator = new RecursiveIteratorIterator(
- $container,
- RecursiveIteratorIterator::SELF_FIRST);
- foreach ($iterator as $page) {
- $page->resource = 'protected';
- }
- $this->_helper->setContainer($container);
- $active = $this->_helper->findOneByLabel('Home');
- $search = array(
- 'start' => 'Page 1',
- 'next' => 'Page 1',
- 'prev' => 'Page 1.1',
- 'chapter' => 'Home',
- 'section' => 'Page 1',
- 'subsection' => 'Page 2.2'
- );
- $expected = array();
- $actual = array();
- foreach ($search as $type => $active) {
- $expected[$type] = false;
- $active = $this->_helper->findOneByLabel($active);
- $found = $this->_helper->findRelation($active, 'rel', $type);
- if (null === $found) {
- $actual[$type] = false;
- } elseif (is_array($found)) {
- $actual[$type] = 'array(' . count($found) . ')';
- } else {
- $actual[$type] = $found->getLabel();
- }
- }
- $this->assertEquals($expected, $actual);
- }
- public function testFindRelationMustSpecifyRelOrRev()
- {
- $active = $this->_helper->findOneByLabel('Home');
- try {
- $this->_helper->findRelation($active, 'foo', 'bar');
- $this->fail('An invalid value was given, but a ' .
- 'Zend_View_Exception was not thrown');
- } catch (Zend_View_Exception $e) {
- $this->assertContains('Invalid argument: $rel', $e->getMessage());
- }
- }
- public function testRenderLinkMustSpecifyRelOrRev()
- {
- $active = $this->_helper->findOneByLabel('Home');
- try {
- $this->_helper->renderLink($active, 'foo', 'bar');
- $this->fail('An invalid value was given, but a ' .
- 'Zend_View_Exception was not thrown');
- } catch (Zend_View_Exception $e) {
- $this->assertContains('Invalid relation attribute', $e->getMessage());
- }
- }
- public function testFindAllRelations()
- {
- $expectedRelations = array(
- 'alternate' => array('Forced page'),
- 'stylesheet' => array('Forced page'),
- 'start' => array('Forced page'),
- 'next' => array('Forced page'),
- 'prev' => array('Forced page'),
- 'contents' => array('Forced page'),
- 'index' => array('Forced page'),
- 'glossary' => array('Forced page'),
- 'copyright' => array('Forced page'),
- 'chapter' => array('Forced page'),
- 'section' => array('Forced page'),
- 'subsection' => array('Forced page'),
- 'appendix' => array('Forced page'),
- 'help' => array('Forced page'),
- 'bookmark' => array('Forced page'),
- 'canonical' => array('Forced page'),
- 'home' => array('Forced page')
- );
- // build expected result
- $expected = array(
- 'rel' => $expectedRelations,
- 'rev' => $expectedRelations
- );
- // find active page and create page to use for relations
- $active = $this->_helper->findOneByLabel('Page 1');
- $forcedRelation = new Zend_Navigation_Page_Uri(array(
- 'label' => 'Forced page',
- 'uri' => '#'
- ));
- // add relations to active page
- foreach ($expectedRelations as $type => $discard) {
- $active->addRel($type, $forcedRelation);
- $active->addRev($type, $forcedRelation);
- }
- // build actual result
- $actual = $this->_helper->findAllRelations($active);
- foreach ($actual as $attrib => $relations) {
- foreach ($relations as $type => $pages) {
- foreach ($pages as $key => $page) {
- $actual[$attrib][$type][$key] = $page->getLabel();
- }
- }
- }
- $this->assertEquals($expected, $actual);
- }
- private function _getFlags()
- {
- return array(
- Zend_View_Helper_Navigation_Links::RENDER_ALTERNATE => 'alternate',
- Zend_View_Helper_Navigation_Links::RENDER_STYLESHEET => 'stylesheet',
- Zend_View_Helper_Navigation_Links::RENDER_START => 'start',
- Zend_View_Helper_Navigation_Links::RENDER_NEXT => 'next',
- Zend_View_Helper_Navigation_Links::RENDER_PREV => 'prev',
- Zend_View_Helper_Navigation_Links::RENDER_CONTENTS => 'contents',
- Zend_View_Helper_Navigation_Links::RENDER_INDEX => 'index',
- Zend_View_Helper_Navigation_Links::RENDER_GLOSSARY => 'glossary',
- Zend_View_Helper_Navigation_Links::RENDER_CHAPTER => 'chapter',
- Zend_View_Helper_Navigation_Links::RENDER_SECTION => 'section',
- Zend_View_Helper_Navigation_Links::RENDER_SUBSECTION => 'subsection',
- Zend_View_Helper_Navigation_Links::RENDER_APPENDIX => 'appendix',
- Zend_View_Helper_Navigation_Links::RENDER_HELP => 'help',
- Zend_View_Helper_Navigation_Links::RENDER_BOOKMARK => 'bookmark',
- Zend_View_Helper_Navigation_Links::RENDER_CUSTOM => 'canonical'
- );
- }
- public function testSingleRenderFlags()
- {
- $active = $this->_helper->findOneByLabel('Home');
- $active->active = true;
- $expected = array();
- $actual = array();
- // build expected and actual result
- foreach ($this->_getFlags() as $newFlag => $type) {
- // add forced relation
- $active->addRel($type, 'http://www.example.com/');
- $active->addRev($type, 'http://www.example.com/');
- $this->_helper->setRenderFlag($newFlag);
- $expectedOutput = '<link '
- . 'rel="' . $type . '" '
- . 'href="http://www.example.com/">' . constant($this->_helperName.'::EOL')
- . '<link '
- . 'rev="' . $type . '" '
- . 'href="http://www.example.com/">';
- $actualOutput = $this->_helper->render();
- $expected[$type] = $expectedOutput;
- $actual[$type] = $actualOutput;
- // remove forced relation
- $active->removeRel($type);
- $active->removeRev($type);
- }
- $this->assertEquals($expected, $actual);
- }
- public function testRenderFlagBitwiseOr()
- {
- $newFlag = Zend_View_Helper_Navigation_Links::RENDER_NEXT |
- Zend_View_Helper_Navigation_Links::RENDER_PREV;
- $this->_helper->setRenderFlag($newFlag);
- $active = $this->_helper->findOneByLabel('Page 1.1');
- $active->active = true;
- // test data
- $expected = '<link rel="next" href="page2" title="Page 2">'
- . constant($this->_helperName.'::EOL')
- . '<link rel="prev" href="page1" title="Page 1">';
- $actual = $this->_helper->render();
- $this->assertEquals($expected, $actual);
- }
- public function testIndenting()
- {
- $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;
- // build expected and actual result
- $expected = ' <link rel="next" href="page2" title="Page 2">'
- . constant($this->_helperName.'::EOL')
- . ' <link rel="prev" href="page1" title="Page 1">';
- $actual = $this->_helper->render();
- $this->assertEquals($expected, $actual);
- }
- public function testSetMaxDepth()
- {
- $this->_helper->setMaxDepth(1);
- $this->_helper->findOneByLabel('Page 2.3.3')->setActive(); // level 2
- $flag = Zend_View_Helper_Navigation_Links::RENDER_NEXT;
- $expected = '<link rel="next" href="page2/page2_3/page2_3_1" title="Page 2.3.1">';
- $actual = $this->_helper->setRenderFlag($flag)->render();
- $this->assertEquals($expected, $actual);
- }
- public function testSetMinDepth()
- {
- $this->_helper->setMinDepth(2);
- $this->_helper->findOneByLabel('Page 2.3')->setActive(); // level 1
- $flag = Zend_View_Helper_Navigation_Links::RENDER_NEXT;
- $expected = '';
- $actual = $this->_helper->setRenderFlag($flag)->render();
- $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);
- }
- }
|