function MenuTrailTestCase::setUp

Overrides MenuWebTestCase::setUp

File

modules/simpletest/tests/menu.test, line 1553

Class

MenuTrailTestCase
Tests active menu trails.

Code

function setUp() {
    $modules = func_get_args();
    if (isset($modules[0]) && is_array($modules[0])) {
        $modules = $modules[0];
    }
    $modules[] = 'menu_test';
    parent::setUp($modules);
    $this->admin_user = $this->drupalCreateUser(array(
        'administer site configuration',
        'access administration pages',
    ));
    $this->drupalLogin($this->admin_user);
    // This test puts menu links in the Navigation menu and then tests for
    // their presence on the page, so we need to ensure that the Navigation
    // block will be displayed in all active themes.
    db_update('block')->fields(array(
        // Use a region that is valid for all themes.
'region' => 'content',
        'status' => 1,
    ))
        ->condition('module', 'system')
        ->condition('delta', 'navigation')
        ->execute();
    // This test puts menu links in the Management menu and then tests for
    // their presence on the page, so we need to ensure that the Management
    // block will be displayed in all active themes.
    db_update('block')->fields(array(
        // Use a region that is valid for all themes.
'region' => 'content',
        'status' => 1,
    ))
        ->condition('module', 'system')
        ->condition('delta', 'management')
        ->execute();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.