function TaxonomyTestBase::setUp

Same name in this branch

Sets up a Drupal site for running functional and integration tests.

Generates a random database prefix and installs Drupal with the specified installation profile in Drupal\simpletest\WebTestBase::$profile into the prefixed database. Afterwards, installs any additional modules specified by the test.

After installation all caches are flushed and several configuration values are reset to the values of the parent site executing the test, since the default values may be incompatible with the environment in which tests are being executed.

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 ViewTestBase::setUp

See also

Drupal\simpletest\WebTestBase::prepareDatabasePrefix()

Drupal\simpletest\WebTestBase::changeDatabasePrefix()

Drupal\simpletest\WebTestBase::prepareEnvironment()

File

drupal/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyTestBase.php, line 47
Contains \Drupal\taxonomy\Tests\Views\TaxonomyTestBase.

Class

TaxonomyTestBase
Base class for all taxonomy tests.

Namespace

Drupal\taxonomy\Tests\Views

Code

function setUp() {
  parent::setUp();
  $this
    ->mockStandardInstall();
  ViewTestData::importTestViews(get_class($this), array(
    'taxonomy_test_views',
  ));
  $this->term1 = $this
    ->createTerm();
  $this->term2 = $this
    ->createTerm();
  $node = array();
  $node['type'] = 'article';
  $node['field_views_testing_tags'][]['tid'] = $this->term1
    ->id();
  $node['field_views_testing_tags'][]['tid'] = $this->term2
    ->id();
  $this->nodes[] = $this
    ->drupalCreateNode($node);
  $this->nodes[] = $this
    ->drupalCreateNode($node);
}