public function testMakeNestedUnorderedList() { $items = array('one', array('four', 'five', 'six'), 'two', 'three'); $list = $this->_helper->htmlList($items); $this->assertContains('<ul>', $list); $this->assertContains('</ul>', $list); $this->assertContains('one<ul><li>four', $list); $this->assertContains('<li>six</li></ul></li><li>two', $list); }
/** * @group ZF-2527 * Added the s modifier to match newlines after @see ZF-5018 */ public function testAttribsPassedIntoMultidimensionalLists() { $items = array('one', array('four', 'five', 'six'), 'two', 'three'); $list = $this->helper->htmlList($items, false, array('class' => 'foo')); foreach ($items[1] as $item) { $this->assertRegexp('#<ul[^>]*?class="foo"[^>]*>.*?(<li>' . $item . ')#s', $list); } }
/** * @see ZF-2870 */ public function testEscapeFlagShouldBePassedRecursively() { $items = array('<b>one</b>', array('<b>four</b>', '<b>five</b>', '<b>six</b>', array('<b>two</b>', '<b>three</b>'))); $list = $this->helper->htmlList($items, false, false, false); $this->assertContains('<ul>', $list); $this->assertContains('</ul>', $list); array_walk_recursive($items, array($this, 'validateItems'), $list); }
/** * @group ZF-2870 */ public function testEscapeFlagShouldBePassedRecursively() { $items = array('<b>one</b>', array('<b>four</b>', '<b>five</b>', '<b>six</b>', array('<b>two</b>', '<b>three</b>'))); $list = $this->helper->__invoke($items, false, false, false); $this->assertContains('<ul>', $list); $this->assertContains('</ul>', $list); $this->markTestSkipped('Wrong array_walk_recursive behavior.'); array_walk_recursive($items, array($this, 'validateItems'), $list); }
public function testListEscapeSwitchedOffForZF2283() { $items = array('one <b>small</b> test'); $list = $this->helper->htmlList($items, false, false, false); $this->assertContains('<ul>', $list); $this->assertContains('</ul>', $list); $this->assertContains('<li>one <b>small</b> test</li>', $list); }