- Patch #652122 by mr.baileys, Berdir, catch: dashboard should insert itself as the default local task on /admin.

merge-requests/26/head
Dries Buytaert 2010-02-17 08:56:48 +00:00
parent 8ee010911c
commit f14395454c
4 changed files with 22 additions and 10 deletions

View File

@ -21,7 +21,7 @@ class BlockTestCase extends DrupalWebTestCase {
parent::setUp();
// Create and login user
$admin_user = $this->drupalCreateUser(array('administer blocks', 'administer filters', 'access administration pages'));
$admin_user = $this->drupalCreateUser(array('administer blocks', 'administer filters', 'access administration pages', 'access dashboard'));
$this->drupalLogin($admin_user);
// Define the existing regions

View File

@ -61,6 +61,18 @@ function dashboard_menu() {
return $items;
}
/**
* Implements hook_menu_alter().
*/
function dashboard_menu_alter(&$items) {
// Make the dashboard the default local task on /admin.
$items['admin']['title'] = 'Dashboard';
$items['admin']['page callback'] = 'dashboard_admin';
$items['admin']['access arguments'] = array('access dashboard');
$items['admin/dashboard']['type'] = MENU_DEFAULT_LOCAL_TASK;
$items['admin/by-task']['type'] = MENU_LOCAL_TASK;
}
/**
* Implements hook_block_info_alter().
*

View File

@ -279,15 +279,15 @@ class SessionHttpsTestCase extends DrupalWebTestCase {
// Verify that user is logged in on secure URL.
$this->curlClose();
$this->drupalGet($this->httpsUrl('admin'), array(), array('Cookie: ' . $cookie));
$this->assertText(t('Administer'));
$this->drupalGet($this->httpsUrl('admin/config'), array(), array('Cookie: ' . $cookie));
$this->assertText(t('Configuration'));
$this->assertResponse(200);
// Verify that user is not logged in on non-secure URL.
if (!$is_https) {
$this->curlClose();
$this->drupalGet('admin', array(), array('Cookie: ' . $cookie));
$this->assertNoText(t('Administer'));
$this->drupalGet('admin/config', array(), array('Cookie: ' . $cookie));
$this->assertNoText(t('Configuration'));
$this->assertResponse(403);
}
@ -340,16 +340,16 @@ class SessionHttpsTestCase extends DrupalWebTestCase {
);
foreach ($cookies as $cookie_key => $cookie) {
foreach (array('admin', $this->httpsUrl('admin')) as $url_key => $url) {
foreach (array('admin/config', $this->httpsUrl('admin/config')) as $url_key => $url) {
$this->curlClose();
$this->drupalGet($url, array(), array('Cookie: ' . $cookie));
if ($cookie_key == $url_key) {
$this->assertText(t('Administer'));
$this->assertText(t('Configuration'));
$this->assertResponse(200);
}
else {
$this->assertNoText(t('Administer'));
$this->assertNoText(t('Configuration'));
$this->assertResponse(403);
}
}

View File

@ -1250,7 +1250,7 @@ class SystemThemeFunctionalTest extends DrupalWebTestCase {
);
$this->drupalPost('admin/appearance', $edit, t('Save configuration'));
$this->drupalGet('admin');
$this->drupalGet('admin/config');
$this->assertRaw('themes/garland', t('Administration theme used on an administration page.'));
$this->drupalGet('node/' . $this->node->nid);
@ -1268,7 +1268,7 @@ class SystemThemeFunctionalTest extends DrupalWebTestCase {
);
$this->drupalPost('admin/appearance', $edit, t('Save configuration'));
$this->drupalGet('admin');
$this->drupalGet('admin/config');
$this->assertRaw('themes/garland', t('Administration theme used on an administration page.'));
$this->drupalGet('node/add');