public function TwigRenderThisTest::setUp in Twig Render This 8
Overrides BrowserTestBase::setUp
File
- tests/
src/ Functional/ TwigRenderThisTest.php, line 34
Class
- TwigRenderThisTest
- Twig Render This tests.
Namespace
Drupal\Tests\twig_render_this\FunctionalCode
public function setUp() {
parent::setUp();
$types = [
'article',
'page',
'product',
];
foreach ($types as $type) {
$type = $this
->createContentType([
'type' => $type,
]);
$node_values = [
'title' => 'This is Twig Render This',
'type' => $type
->id(),
];
$this
->createNode($node_values);
}
$nodes = [
'Start Trek TNG' => 'Star Trek: The Next Generation (TNG) is an American science fiction television series created by Gene Roddenberry.',
'Start Trek DS9' => 'Star Trek: Deep Space Nine (DS9) is an American science fiction television series created by Rick Berman and Michael Piller.',
'Start Trek Voyager' => 'Star Trek: Voyager is an American science fiction television series created by Rick Berman, Michael Piller, and Jeri Taylor.',
];
foreach ($nodes as $title => $description) {
$this
->createNode([
'type' => 'news',
'title' => $title,
'field_description' => $description,
]);
}
}