You are here

public function BambooTwigRenderTest::setUp in Bamboo Twig 8.3

Same name and namespace in other branches
  1. 8.5 tests/src/Functional/BambooTwigRenderTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigRenderTest::setUp()
  2. 8.2 tests/src/Functional/BambooTwigRenderTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigRenderTest::setUp()
  3. 8.4 tests/src/Functional/BambooTwigRenderTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigRenderTest::setUp()

Overrides BrowserTestBase::setUp

File

tests/src/Functional/BambooTwigRenderTest.php, line 36

Class

BambooTwigRenderTest
Tests Renders twig filters and functions.

Namespace

Drupal\Tests\bamboo_twig\Functional

Code

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

  // Create an article content type that we will use for testing.
  $this
    ->drupalCreateContentType([
    'type' => 'article',
    'name' => 'Article',
  ]);

  // Create an article node that we will use for testing.
  $this->article = $this
    ->drupalCreateNode([
    'title' => 'Hello, world!',
    'type' => 'article',
  ]);
  $this->article
    ->save();

  // Create a user for tests.
  $this->admin_user = $this
    ->drupalCreateUser([
    'access content',
    'administer blocks',
    'administer content types',
    'bypass node access',
    'administer site configuration',
    'view the administration theme',
    'administer menu',
    'access administration pages',
  ]);

  // Create a taxonomy term for tests.
  $this->vocabulary = $this
    ->createVocabulary();
  $this->term = $this
    ->createTerm($this->vocabulary);

  // Create a file for tests.
  $this->file = $this
    ->createFile();
  $this->container
    ->get('router.builder')
    ->rebuild();
}