You are here

protected function VoteTokenTest::setUp in Voting API 8.3

Overrides KernelTestBase::setUp

File

modules/votingapi_tokens/tests/src/Kernel/VoteTokenTest.php, line 44

Class

VoteTokenTest
Tests the Voting API basics.

Namespace

Drupal\Tests\votingapi_tokens\Kernel

Code

protected function setUp() {
  parent::setUp();
  \Drupal::service('router.builder')
    ->rebuild();
  $this
    ->installConfig([
    'system',
  ]);
  $this
    ->installEntitySchema('user');
  $this
    ->installEntitySchema('node');
  $this
    ->installEntitySchema('vote');
  $this
    ->installEntitySchema('vote_result');
  $this
    ->installSchema('node', [
    'node_access',
  ]);
  $this
    ->installConfig([
    'node',
    'votingapi',
    'field',
  ]);
  $node_type = NodeType::create([
    'type' => 'page',
    'name' => 'Basic page',
    'description' => "Use <em>basic pages</em> for your static content, such as an 'About us' page.",
  ]);
  $node_type
    ->save();
  $this->node = Node::create([
    'type' => 'page',
    'title' => 'Source Title',
    'revision_log' => $this
      ->randomMachineName(),
  ]);
  $this->node
    ->save();
}