? menu_rebuild_3.patch
? reset.php
? sites/default/files
? sites/default/settings.php
Index: modules/simpletest/tests/hook_menu.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/hook_menu.module,v
retrieving revision 1.1
diff -u -p -r1.1 hook_menu.module
--- modules/simpletest/tests/hook_menu.module	2 Sep 2008 19:23:02 -0000	1.1
+++ modules/simpletest/tests/hook_menu.module	12 Oct 2008 21:43:22 -0000
@@ -3,18 +3,34 @@
 
 /**
  * @file
- * Dummy module implementing hook menu to test changing the menu name.
+ * Dummy module implementing hook menu for menu system tests.
  */
 
- /**
- * The name of the menu changes during the course of this test. Use a $_GET.
+/**
+ * Implmentation of hook_perm().
+ */
+function hook_menu_perm() {
+  return array(
+    'access test callback' => 'A permission for testing default menu callbacks.',
+  );
+}
+
+/**
+ * Implementation of hook_menu().
  */
 function hook_menu_menu() {
 
+  // The name of the menu changes during the course of this test. Use a $_GET.
   $items['menu_name_test'] = array(
     'title' => t('Test menu_name router item'),
     'page callback' => 'node_save',
     'menu_name' => isset($_GET["hook_menu_name"]) ? $_GET["hook_menu_name"] : 'original',
   );
+  $items['default_access_callback'] = array(
+    'title' => 'Test default access callback',
+    'page callback' => 'node_page_default',
+    'access arguments' => array('access test callback'),
+    'type' => MENU_CALLBACK,
+  );
   return $items;
 }
\ No newline at end of file
Index: modules/simpletest/tests/menu.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/menu.test,v
retrieving revision 1.2
diff -u -p -r1.2 menu.test
--- modules/simpletest/tests/menu.test	15 Sep 2008 20:48:09 -0000	1.2
+++ modules/simpletest/tests/menu.test	12 Oct 2008 21:43:22 -0000
@@ -45,3 +45,45 @@ class MenuIncTestCase extends DrupalWebT
     $this->assertEqual($name, 'changed', t('Menu name was successfully changed after rebuild.'));
   }
 }
+
+
+/**
+ * Tests the default access callback for menu items.
+ */
+class MenuAccessTestCase extends DrupalWebTestCase {
+  /**
+   * Implementation of getInfo.
+   */
+  function getInfo() {
+    return array(
+      'name' => t('Default access callback'),
+      'description' => t('Tests default menu access default callback.'),
+      'group' => t('Menu')
+    );
+  }
+  
+  /**
+   * Implementation of setUp().
+   */
+  function setUp() {
+    // Enable dummy module that implements hook_menu.
+    parent::setUp('hook_menu');
+  }
+  
+  /**
+   * Test that the default access callback for menu items is working correctly.
+   */
+  function testMenuDefaultAccessCallback() {
+    // Test with authorized user.
+    $web_user = $this->drupalCreateUser(array('access test callback'));
+    $this->drupalLogin($web_user);
+    $this->drupalGet('default_access_callback');
+    $this->assertResponse(200, t('User with permissions can access menu item using default access callback.'));
+    
+    // Test with an unauthorized user.
+    $web_user = $this->drupalCreateUser();
+    $this->drupalLogin($web_user);
+    $this->drupalGet('default_access_callback');
+    $this->assertResponse(403, t('User without permissions is denied access using default access callback.')); 
+  }
+}
\ No newline at end of file
