public function TemplateControllerTest::setUp in Wysiwyg API template plugin 3.0.x
Same name and namespace in other branches
- 8.2 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\ControllerCode
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();
}
}