trait RevisionsTestTrait in GraphQL 8.3
Helper methods associated with revisions.
Hierarchy
- trait \Drupal\Tests\graphql_core\Traits\RevisionsTestTrait
1 file declares its use of RevisionsTestTrait
- GraphQLContentTestBase.php in modules/
graphql_core/ tests/ src/ Kernel/ GraphQLContentTestBase.php
File
- modules/
graphql_core/ tests/ src/ Traits/ RevisionsTestTrait.php, line 10
Namespace
Drupal\Tests\graphql_core\TraitsView source
trait RevisionsTestTrait {
/**
* Returns a new, unpublished draft of given node.
*
* @param \Drupal\node\NodeInterface $node
*
* @return \Drupal\node\NodeInterface
*/
protected function getNewDraft(NodeInterface $node) {
$node
->setNewRevision();
$node
->isDefaultRevision(FALSE);
$node
->setPublished(FALSE);
return $node;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RevisionsTestTrait:: |
protected | function | Returns a new, unpublished draft of given node. |