You are here

public function FeedsWebTestCase::setUp in Feeds 6

Same name and namespace in other branches
  1. 7.2 tests/feeds.test \FeedsWebTestCase::setUp()

Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix. A temporary files directory is created with the same name as the database prefix.

Parameters

...: List of modules to enable for the duration of the test. This can be either a single array or a variable number of string arguments.

Overrides DrupalWebTestCase::setUp

21 calls to FeedsWebTestCase::setUp()
FeedsDateTimeTest::setUp in tests/feeds_date_time.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
FeedsExamplesFastFeedTestCase::setUp in feeds_fast_news/feeds_fast_news.test
Set up test.
FeedsExamplesFeedTestCase::setUp in feeds_news/feeds_news.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
FeedsExamplesNodeTestCase::setUp in feeds_import/feeds_import.test
Set up test.
FeedsExamplesOPMLTestCase::setUp in feeds_news/feeds_news.test
Set up test.

... See full list

21 methods override FeedsWebTestCase::setUp()
FeedsDateTimeTest::setUp in tests/feeds_date_time.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
FeedsExamplesFastFeedTestCase::setUp in feeds_fast_news/feeds_fast_news.test
Set up test.
FeedsExamplesFeedTestCase::setUp in feeds_news/feeds_news.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
FeedsExamplesNodeTestCase::setUp in feeds_import/feeds_import.test
Set up test.
FeedsExamplesOPMLTestCase::setUp in feeds_news/feeds_news.test
Set up test.

... See full list

File

tests/feeds.test, line 13
Common functionality for all Feeds tests.

Class

FeedsWebTestCase
Test basic Data API functionality.

Code

public function setUp() {
  $args = func_get_args();

  // Build the list of required modules which can be altered by passing in an
  // array of module names to setUp().
  if (isset($args[0])) {
    if (is_array($args[0])) {
      $modules = $args[0];
    }
    else {
      $modules = $args;
    }
  }
  else {
    $modules = array();
  }
  $modules[] = 'taxonomy';
  $modules[] = 'feeds';
  $modules[] = 'feeds_ui';

  //$modules[] = 'feeds_tests';
  $modules[] = 'ctools';
  $modules[] = 'job_scheduler';
  $modules = array_unique($modules);
  parent::setUp($modules);

  // Build the list of required administration permissions. Additional
  // permissions can be passed as an array into setUp()'s second parameter.
  if (isset($args[1]) && is_array($args[1])) {
    $permissions = $args[1];
  }
  else {
    $permissions = array();
  }
  $permissions[] = 'access content';
  $permissions[] = 'administer site configuration';
  $permissions[] = 'administer content types';
  $permissions[] = 'administer nodes';
  $permissions[] = 'administer taxonomy';
  $permissions[] = 'administer users';
  $permissions[] = 'administer feeds';

  // Create an admin user and log in.
  $this->admin_user = $this
    ->drupalCreateUser($permissions);
  $this
    ->drupalLogin($this->admin_user);
}