protected function ViewUnitTestBase::setUp

Sets up Drupal unit test environment.

Overrides DrupalUnitTestBase::setUp

See also

DrupalUnitTestBase::$modules

DrupalUnitTestBase

13 calls to ViewUnitTestBase::setUp()
AreaTextTest::setUp in drupal/core/modules/views/lib/Drupal/views/Tests/Handler/AreaTextTest.php
Sets up Drupal unit test environment.
FieldCounterTest::setUp in drupal/core/modules/views/lib/Drupal/views/Tests/Handler/FieldCounterTest.php
Sets up Drupal unit test environment.
FieldUnitTest::setUp in drupal/core/modules/views/lib/Drupal/views/Tests/Handler/FieldUnitTest.php
Sets up Drupal unit test environment.
FilterEqualityTest::setUp in drupal/core/modules/views/lib/Drupal/views/Tests/Handler/FilterEqualityTest.php
Sets up Drupal unit test environment.
FilterInOperatorTest::setUp in drupal/core/modules/views/lib/Drupal/views/Tests/Handler/FilterInOperatorTest.php
Sets up Drupal unit test environment.

... See full list

13 methods override ViewUnitTestBase::setUp()
AreaTextTest::setUp in drupal/core/modules/views/lib/Drupal/views/Tests/Handler/AreaTextTest.php
Sets up Drupal unit test environment.
FieldCounterTest::setUp in drupal/core/modules/views/lib/Drupal/views/Tests/Handler/FieldCounterTest.php
Sets up Drupal unit test environment.
FieldUnitTest::setUp in drupal/core/modules/views/lib/Drupal/views/Tests/Handler/FieldUnitTest.php
Sets up Drupal unit test environment.
FilterEqualityTest::setUp in drupal/core/modules/views/lib/Drupal/views/Tests/Handler/FilterEqualityTest.php
Sets up Drupal unit test environment.
FilterInOperatorTest::setUp in drupal/core/modules/views/lib/Drupal/views/Tests/Handler/FilterInOperatorTest.php
Sets up Drupal unit test environment.

... See full list

File

drupal/core/modules/views/lib/Drupal/views/Tests/ViewUnitTestBase.php, line 27
Contains \Drupal\views\Tests\ViewUnitTestBase.

Class

ViewUnitTestBase
Defines a base class for Views unit testing.

Namespace

Drupal\views\Tests

Code

protected function setUp() {
  parent::setUp();

  // Define the schema and views data variable before enabling the test module.
  $GLOBALS['views_test_data_schema'] = $this
    ->schemaDefinition();
  $GLOBALS['views_test_data_views_data'] = $this
    ->viewsData();
  $this
    ->enableModules(array(
    'views',
    'views_test_config',
    'views_test_data',
  ));

  // Load the test dataset.
  $data_set = $this
    ->dataSet();
  $query = db_insert('views_test_data')
    ->fields(array_keys($data_set[0]));
  foreach ($data_set as $record) {
    $query
      ->values($record);
  }
  $query
    ->execute();
  ViewTestData::importTestViews(get_class($this));
}