function RelationshipJoinTestBase::setUpFixtures

Same name and namespace in other branches
  1. 8.9.x core/modules/views/tests/src/Kernel/Plugin/RelationshipJoinTestBase.php \Drupal\Tests\views\Kernel\Plugin\RelationshipJoinTestBase::setUpFixtures()
  2. 10 core/modules/views/tests/src/Kernel/Plugin/RelationshipJoinTestBase.php \Drupal\Tests\views\Kernel\Plugin\RelationshipJoinTestBase::setUpFixtures()
  3. 11.x core/modules/views/tests/src/Kernel/Plugin/RelationshipJoinTestBase.php \Drupal\Tests\views\Kernel\Plugin\RelationshipJoinTestBase::setUpFixtures()

Sets up the configuration and schema of views and views_test_data modules.

Because the schema of views_test_data.module is dependent on the test using it, it cannot be enabled normally.

Overrides ViewsKernelTestBase::setUpFixtures

File

core/modules/views/tests/src/Kernel/Plugin/RelationshipJoinTestBase.php, line 32

Class

RelationshipJoinTestBase
Provides a base class for a testing a relationship.

Namespace

Drupal\Tests\views\Kernel\Plugin

Code

protected function setUpFixtures() {
  $this->installEntitySchema('user');
  $this->installConfig([
    'user',
  ]);
  parent::setUpFixtures();
  // Create a record for uid 1.
  $this->rootUser = User::create([
    'name' => $this->randomMachineName(),
  ]);
  $this->rootUser
    ->save();
  Views::viewsData()->clear();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.