From 8eac449d56cda1a3455f1210cfba99147cbca57d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 3 Jul 2014 15:07:47 +0200 Subject: [PATCH] Adjust the test for Icinga\Web\MenuItem as its test subject has changed refs #6153 --- test/php/library/Icinga/Web/MenuItemTest.php | 29 -------------------- test/php/library/Icinga/Web/MenuTest.php | 29 ++++++++++++++++++++ 2 files changed, 29 insertions(+), 29 deletions(-) delete mode 100644 test/php/library/Icinga/Web/MenuItemTest.php create mode 100644 test/php/library/Icinga/Web/MenuTest.php 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' + ); + } +}