diff --git a/test/php/library/Icinga/Web/MenuItemTest.php b/test/php/library/Icinga/Web/MenuItemTest.php deleted file mode 100644 index f8234ab5e..000000000 --- a/test/php/library/Icinga/Web/MenuItemTest.php +++ /dev/null @@ -1,29 +0,0 @@ -addChild(5, new Zend_Config(array('title' => 'ccc5'))); - $item->addChild(0, new Zend_Config(array('title' => 'aaa'))); - $item->addChild(3, new Zend_Config(array('title' => 'ccc'))); - $item->addChild(2, new Zend_Config(array('title' => 'bbb'))); - $item->addChild(4, new Zend_Config(array('title' => 'ccc2'))); - $item->addChild(1, new Zend_Config(array('title' => 'bb'))); - - $this->assertEquals( - array('aaa', 'bb', 'bbb', 'ccc', 'ccc2', 'ccc5'), - array_map(function ($it) { return $it->getTitle(); }, $item->getChildren()), - 'MenuItem::getChildren does not return its elements in natural order' - ); - } -} diff --git a/test/php/library/Icinga/Web/MenuTest.php b/test/php/library/Icinga/Web/MenuTest.php new file mode 100644 index 000000000..eb6456773 --- /dev/null +++ b/test/php/library/Icinga/Web/MenuTest.php @@ -0,0 +1,29 @@ +addSubMenu(5, new Zend_Config(array('title' => 'ccc5'))); + $menu->addSubMenu(0, new Zend_Config(array('title' => 'aaa'))); + $menu->addSubMenu(3, new Zend_Config(array('title' => 'ccc'))); + $menu->addSubMenu(2, new Zend_Config(array('title' => 'bbb'))); + $menu->addSubMenu(4, new Zend_Config(array('title' => 'ccc2'))); + $menu->addSubMenu(1, new Zend_Config(array('title' => 'bb'))); + + $this->assertEquals( + array('aaa', 'bb', 'bbb', 'ccc', 'ccc2', 'ccc5'), + array_map(function ($m) { return $m->getTitle(); }, iterator_to_array($menu->order())), + 'Menu::order() does not return its elements in natural order' + ); + } +}