You are here

trait RevisionsTestTrait in GraphQL 8.3

Helper methods associated with revisions.

Hierarchy

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\Traits
View 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

Namesort descending Modifiers Type Description Overrides
RevisionsTestTrait::getNewDraft protected function Returns a new, unpublished draft of given node.