function WorkspacesContentModerationStateTest::createContentType
Creates a custom content type based on default settings.
Parameters
array $values: An array of settings to change from the defaults. Example: 'type' => 'foo'.
bool $create_body: Whether to create the body field.
Return value
\Drupal\node\Entity\NodeType Created content type.
Overrides ContentTypeCreationTrait::createContentType
3 calls to WorkspacesContentModerationStateTest::createContentType()
- WorkspacesContentModerationStateTest::testContentModerationIntegrationWithWorkspaces in core/
modules/ content_moderation/ tests/ src/ Kernel/ WorkspacesContentModerationStateTest.php - Tests the integration between Content Moderation and Workspaces.
- WorkspacesContentModerationStateTest::testContentModerationMultipleEntityTypesWithWorkspaces in core/
modules/ content_moderation/ tests/ src/ Kernel/ WorkspacesContentModerationStateTest.php - Publish a workspace with multiple entities from different entity types.
- WorkspacesContentModerationStateTest::testContentModerationWithoutDefaultRevisionsInWorkspaces in core/
modules/ content_moderation/ tests/ src/ Kernel/ WorkspacesContentModerationStateTest.php - Publish a workspace with workflows including no tracked default revisions.
File
-
core/
modules/ content_moderation/ tests/ src/ Kernel/ WorkspacesContentModerationStateTest.php, line 351
Class
- WorkspacesContentModerationStateTest
- Tests that Workspaces and Content Moderation work together properly.
Namespace
Drupal\Tests\content_moderation\KernelCode
protected function createContentType(array $values = [], bool $create_body = TRUE) {
$note_type = $this->workspaceManager
->executeOutsideWorkspace(function () use ($values, $create_body) {
return $this->traitCreateContentType($values, $create_body);
});
return $note_type;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.