Commit f6577daf authored by Dave Reid's avatar Dave Reid

by Dave Reid: Updated to pass user tests.

parent 6b5af456
......@@ -54,6 +54,22 @@ function xmlsitemap_user_user_presave(&$edit, $account, $category) {
xmlsitemap_save_link($link);
}
/**
* Implements hook_user_insert().
*/
function xmlsitemap_user_user_insert(&$edit, $account, $category) {
$link = xmlsitemap_user_create_link($account);
xmlsitemap_save_link($link);
}
/**
* Implements hook_user_update().
*/
function xmlsitemap_user_user_update(&$edit, $account, $category) {
$link = xmlsitemap_user_create_link($account);
xmlsitemap_save_link($link);
}
/**
* Implements hook_user_cancel().
*/
......
......@@ -21,9 +21,16 @@ class XMLSitemapUserFunctionalTest extends XMLSitemapTestHelper {
function setUp() {
parent::setUp('xmlsitemap_user');
// Save the user settings before creating the users.
xmlsitemap_link_bundle_settings_save('user', 'user', array('status' => 1, 'priority' => 0.5));
// Create the users
$this->admin_user = $this->drupalCreateUser(array('administer users', 'administer permissions', 'administer xmlsitemap'));
$this->normal_user = $this->drupalCreateUser(array('access content'));
xmlsitemap_link_bundle_settings_save('user', 'user', array('status' => 1, 'priority' => 0.5));
// Update the normal user to make its sitemap link visible.
$account = clone $this->normal_user;
user_save($account, array('access' => 1, 'login' => 1));
}
function testBlockedUser() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment