diff options
Diffstat (limited to 'modules/node')
-rw-r--r-- | modules/node/node.module | 6 | ||||
-rw-r--r-- | modules/node/node.test | 56 |
2 files changed, 59 insertions, 3 deletions
diff --git a/modules/node/node.module b/modules/node/node.module index af28dd192..68997c9f9 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -789,7 +789,7 @@ function node_type_set_defaults($info = array()) { * @param $hook * A string containing the name of the hook. * @return - * TRUE iff the $hook exists in the node type of $node. + * TRUE if the $hook exists in the node type of $node. */ function node_hook($node, $hook) { $base = node_type_get_base($node); @@ -2870,7 +2870,7 @@ function node_access_rebuild($batch_mode = FALSE) { } else { // Not using any node_access modules. Add the default grant. - db_insert('node_accesss') + db_insert('node_access') ->fields(array( 'nid' => 0, 'realm' => 'all', @@ -3392,7 +3392,7 @@ function node_requirements($phase) { $requirements['node_access'] = array( 'title' => $t('Node Access Permissions'), 'value' => $value, - 'description' => $description . ' ' . l('Rebuild Permissions', 'admin/reports/status/rebuild'), + 'description' => $description . ' ' . l('Rebuild permissions', 'admin/reports/status/rebuild'), ); return $requirements; } diff --git a/modules/node/node.test b/modules/node/node.test index 38707b26f..df88bafcb 100644 --- a/modules/node/node.test +++ b/modules/node/node.test @@ -833,3 +833,59 @@ class NodeTypeTestCase extends DrupalWebTestCase { $this->assertEqual($node_types['page']->base, node_type_get_base('page'), t('Correct node type base has been returned.')); } } + +/** + * Rebuild the node_access table. + */ +class NodeAccessRebuildTestCase extends DrupalWebTestCase { + function getInfo() { + return array( + 'name' => t('Node access rebuild'), + 'description' => t('Ensures that node access rebuild functions work correctly.'), + 'group' => t('Node'), + ); + } + + function setUp() { + parent::setUp(); + + $web_user = $this->drupalCreateUser(array('administer site configuration', 'access administration pages', 'access site reports')); + $this->drupalLogin($web_user); + $this->web_user = $web_user; + } + + function testNodeAccessRebuild() { + $this->drupalGet('admin/reports/status'); + $this->clickLink(t('Rebuild permissions')); + $this->drupalPost(NULL, array(), t('Rebuild permissions')); + $this->assertText(t('Content permissions have been rebuilt.')); + } +} + +/** + * Rebuild the node_access table. + */ +class NodeAccessRebuildTestCase extends DrupalWebTestCase { + function getInfo() { + return array( + 'name' => t('Node access rebuild'), + 'description' => t('Ensures that node access rebuild functions work correctly.'), + 'group' => t('Node'), + ); + } + + function setUp() { + parent::setUp(); + + $web_user = $this->drupalCreateUser(array('administer site configuration', 'access administration pages', 'access site reports')); + $this->drupalLogin($web_user); + $this->web_user = $web_user; + } + + function testNodeAccessRebuild() { + $this->drupalGet('admin/reports/status'); + $this->clickLink(t('Rebuild permissions')); + $this->drupalPost(NULL, array(), t('Rebuild permissions')); + $this->assertText(t('Content permissions have been rebuilt.')); + } +} |