You are here

public function BambooTwigLoaderTest::setUp in Bamboo Twig 8

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

Overrides BrowserTestBase::setUp

File

tests/src/Functional/BambooTwigLoadersTest.php, line 26

Class

BambooTwigLoaderTest
Tests Loaders 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 a page content type that we will use for testing.
  $this
    ->drupalCreateContentType([
    'type' => 'page',
    'name' => 'Basic page',
  ]);

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

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

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