summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/menu.test
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2008-09-02 19:23:02 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2008-09-02 19:23:02 +0000
commitc17a5e70bca3113bc7e9dbb42c01e9abe47aa063 (patch)
tree5dd373f83c2921f7217f7b65516e07b90c18a64c /modules/simpletest/tests/menu.test
parent6511f56e4b62f667138b6bab184b20c53e651cee (diff)
downloadbrdo-c17a5e70bca3113bc7e9dbb42c01e9abe47aa063.tar.gz
brdo-c17a5e70bca3113bc7e9dbb42c01e9abe47aa063.tar.bz2
#285309 by pwolanin: menu_name in hook_menu is ignored on updates
Diffstat (limited to 'modules/simpletest/tests/menu.test')
-rw-r--r--modules/simpletest/tests/menu.test47
1 files changed, 47 insertions, 0 deletions
diff --git a/modules/simpletest/tests/menu.test b/modules/simpletest/tests/menu.test
new file mode 100644
index 000000000..93e4a4a53
--- /dev/null
+++ b/modules/simpletest/tests/menu.test
@@ -0,0 +1,47 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Provides SimpleTests for menu.inc.
+ */
+
+class MenuIncTestCase extends DrupalWebTestCase {
+ /**
+ * Implementation of getInfo().
+ */
+ function getInfo() {
+ return array(
+ 'name' => t('Hook menu tests'),
+ 'description' => t('Test menu hook functionality.'),
+ 'group' => t('Menu'),
+ );
+ }
+
+ /**
+ * Implementation of setUp().
+ */
+ function setUp() {
+ // Enable dummy module that implements hook_menu.
+ parent::setUp('hook_menu');
+ }
+
+ /**
+ * Tests for menu_name parameter for hook_menu().
+ */
+ function testMenuName() {
+ $admin_user = $this->drupalCreateUser(array('administer site configuration'));
+ $this->drupalLogin($admin_user);
+
+ $sql = "SELECT menu_name FROM {menu_links} WHERE router_path = 'menu_name_test'";
+ $name = db_result(db_query($sql));
+ $this->assertEqual($name, 'original', t('Menu name is "original".'));
+
+ // Force a menu rebuild by going to the modules page.
+ $this->drupalGet('admin/build/modules', array('query' => array("hook_menu_name" => 'changed')));
+
+ $sql = "SELECT menu_name FROM {menu_links} WHERE router_path = 'menu_name_test'";
+ $name = db_result(db_query($sql));
+ $this->assertEqual($name, 'changed', t('Menu name was successfully changed after rebuild.'));
+ }
+}