/ */ class Ui_Test_DijitMenuTest extends ModuleTest { /** * Verify nested menu gets properly output */ public function testRenderNestedMenu() { $view = Zend_Layout::getMvcInstance()->getView(); $helper = $view->navigation()->findHelper('dijitMenu'); $output = $helper->renderMenu( new P4Cms_Navigation( array( array( 'label' => 'Test', 'uri' => 'http://example.com', 'class' => 'blahIcon', 'onShow' => 'console.log("show");', 'pages' => array( array( 'label' => 'Test2', 'uri' => '', 'onClick' => 'alert("hello!");', 'class' => 'blahIcon', 'onShow' => 'console.log("show");' ) ) ) ) ), array( 'attribs' => array( 'id' => 'test', 'style' => 'display:none;' ) ) ); $expected = ''; $this->assertSame($expected, $output, 'Expected matching output.'); } /** * Verify flat menu gets properly output */ public function testRenderFlatMenu() { $view = Zend_Layout::getMvcInstance()->getView(); $helper = $view->navigation()->findHelper('dijitMenu'); $output = $helper->renderMenu( new P4Cms_Navigation( array( array( 'label' => 'Test', 'uri' => 'http://example.com', 'class' => 'blahIcon', 'onShow' => 'console.log("show");', ), array( 'label' => '-' ), array( 'label' => '--' ), array( 'label' => 'Test2', 'uri' => '', 'onClick' => 'alert("hello!");', 'class' => 'blahIcon', 'onShow' => 'console.log("show");' ) ) ), array( 'attribs' => array( 'id' => 'test', 'style' => 'display:none;' ) ) ); $expected = ''; $this->assertSame($expected, $output, 'Expected matching output.'); } }