You are here

public function TemplateControllerTest::setUp in Wysiwyg API template plugin 8.2

Same name and namespace in other branches
  1. 3.0.x tests/src/Kernel/Controller/TemplateControllerTest.php \Drupal\Tests\wysiwyg_template\Kernel\Controller\TemplateControllerTest::setUp()

Overrides KernelTestBase::setUp

File

tests/src/Kernel/Controller/TemplateControllerTest.php, line 49

Class

TemplateControllerTest
Tests the template controller object.

Namespace

Drupal\Tests\wysiwyg_template\Kernel\Controller

Code

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

  // TODO: Change the autogenerated stub
  $this->controller = TemplateController::create($this->container);

  // Create a few node types.
  foreach (range(1, 3) as $i) {
    $this->nodeTypes[$i] = NodeType::create([
      'type' => strtolower($this
        ->randomMachineName()),
      'name' => $this
        ->randomString(),
    ]);
    $this->nodeTypes[$i]
      ->save();
  }
}