protected function LatestRevisionViewsFilterTest::createNodeType in Workbench Moderation 8
Same name and namespace in other branches
- 8.2 tests/src/Functional/LatestRevisionViewsFilterTest.php \Drupal\Tests\workbench_moderation\Functional\LatestRevisionViewsFilterTest::createNodeType()
Creates a new node type.
Parameters
string $label: The human-readable label of the type to create.
string $machine_name: The machine name of the type to create.
Return value
\Drupal\node\Entity\NodeType The node type just created.
1 call to LatestRevisionViewsFilterTest::createNodeType()
- LatestRevisionViewsFilterTest::testViewShowsCorrectNids in tests/
src/ Functional/ LatestRevisionViewsFilterTest.php - Test nids view showing are correct or not.
File
- tests/
src/ Functional/ LatestRevisionViewsFilterTest.php, line 134
Class
- LatestRevisionViewsFilterTest
- Tests the "Latest Revision" views filter.
Namespace
Drupal\Tests\workbench_moderation\FunctionalCode
protected function createNodeType($label, $machine_name) {
/** @var \Drupal\node\Entity\NodeType $node_type */
$node_type = NodeType::create([
'type' => $machine_name,
'label' => $label,
]);
$node_type
->save();
return $node_type;
}