You are here

function QuicktabsAdminTestCase::setUp in Quick Tabs 7.3

Implementation of setUp().

Overrides DrupalWebTestCase::setUp

File

tests/quicktabs.test, line 19

Class

QuicktabsAdminTestCase

Code

function setUp() {
  parent::setUp('ctools', 'quicktabs');

  // Create and login user
  $admin_user = $this
    ->drupalCreateUser(array(
    'access administration pages',
    'administer quicktabs',
    'administer nodes',
  ));
  $this
    ->drupalLogin($admin_user);

  // Create some nodes that we can populate our tabs with.
  for ($i = 0; $i < 5; $i++) {
    $node = new stdClass();
    $node->type = 'page';
    $node->title = 'This is node number ' . ($i + 1);
    $node->body[LANGUAGE_NONE][0]['value'] = $this
      ->randomString(255);
    node_object_prepare($node);
    node_save($node);
  }
}