diff --git a/core/modules/grid/lib/Drupal/grid/Tests/GridTest.php b/core/modules/grid/lib/Drupal/grid/Tests/GridTest.php index 258bb53..6a7f7eb 100644 --- a/core/modules/grid/lib/Drupal/grid/Tests/GridTest.php +++ b/core/modules/grid/lib/Drupal/grid/Tests/GridTest.php @@ -29,16 +29,18 @@ public static function getInfo() { ); } + function setUp() { + parent::setUp(); + + // Create a new user, allow to manage grids. + $admin_user = $this->drupalCreateUser(array('administer grids')); + $this->drupalLogin($admin_user); + } + /** * Tests the default grids. */ function testDefaultGrids() { - // Create a new user, allow to manage grids. - $admin_user = $this->drupalCreateUser(array( - 'administer grids', - )); - $this->drupalLogin($admin_user); - // Check that these grids show up on the user interface. $test_grids = array( 'ninesixty_12' => '960px wide, 12 column grid', @@ -58,12 +60,6 @@ function testDefaultGrids() { * Tests editing a default grid. */ function testEditDefaultGrid() { - // Create a new user, allow to manage grids. - $admin_user = $this->drupalCreateUser(array( - 'administer grids', - )); - $this->drupalLogin($admin_user); - $this->drupalGet('admin/structure/grids/manage/fluid_6/edit'); $this->assertResponse(200); $this->assertPattern('!disabled="disabled"(.+)id="edit-id"(.+)value="fluid_6"!', 'Existing grid machine name field is disabled.'); @@ -79,12 +75,6 @@ function testEditDefaultGrid() { * Tests deleting a default grid. */ function testDeleteDefaultGrid() { - // Create a new user, allow to manage grids. - $admin_user = $this->drupalCreateUser(array( - 'administer grids', - )); - $this->drupalLogin($admin_user); - $this->drupalGet('admin/structure/grids/manage/fluid_12/delete'); $this->assertResponse(200); @@ -97,12 +87,6 @@ function testDeleteDefaultGrid() { * Tests adding new grids and all actions on them. */ function testNewGrid() { - // Create a new user, allow to manage grids. - $admin_user = $this->drupalCreateUser(array( - 'administer grids', - )); - $this->drupalLogin($admin_user); - $edit = array('label' => 'Three column fluid', 'id' => 'fluid_3', 'columns' => '3', 'units' => '%', 'padding_width' => '1.5', 'gutter_width' => '2'); $this->drupalPost('admin/structure/grids/add', $edit, t('Save')); $this->assertText('fluid_3');