You are here

protected function AccessTest::setUp in Twig Tweak 8

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/AccessTest.php \Drupal\Tests\twig_tweak\Kernel\AccessTest::setUp()

Overrides KernelTestBase::setUp

File

tests/src/Kernel/AccessTest.php, line 54

Class

AccessTest
Tests for the Twig Tweak access control.

Namespace

Drupal\Tests\twig_tweak\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installEntitySchema('node');
  $this
    ->installEntitySchema('user');
  $this
    ->installConfig([
    'system',
  ]);
  $node_type = NodeType::create([
    'type' => 'article',
    'name' => 'Article',
  ]);
  $node_type
    ->save();
  $values = [
    'type' => 'article',
    'status' => NodeInterface::PUBLISHED,
    // @see twig_tweak_test_node_access()
    'title' => 'Entity access test',
  ];
  $this->node = Node::create($values);
  $this->node
    ->save();
  $this->twigExtension = $this->container
    ->get('twig_tweak.twig_extension');
}