RevisionsTestTrait.php in GraphQL 8.3
Namespace
Drupal\Tests\graphql_core\TraitsFile
modules/graphql_core/tests/src/Traits/RevisionsTestTrait.phpView source
<?php
namespace Drupal\Tests\graphql_core\Traits;
use Drupal\node\NodeInterface;
/**
* Helper methods associated with revisions.
*/
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;
}
}
Traits
Name | Description |
---|---|
RevisionsTestTrait | Helper methods associated with revisions. |