Skip to content

Commit

Permalink
Issue #3151975 by daffie, narendra.rajwar27: Replace the database que…
Browse files Browse the repository at this point in the history
…ry with an entity query in NodeRevisionsTest

(cherry picked from commit b52340d155426791a13641ea329dc19c6ad9a42a)
  • Loading branch information
alexpott committed Jul 14, 2020
1 parent 6ccbf4a commit 0ce2b9b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/node/tests/src/Functional/NodeRevisionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,13 @@ public function testRevisions() {
'%title' => $nodes[1]->label(),
]), 'Revision deleted.');
$connection = Database::getConnection();
$this->assertTrue($connection->query('SELECT COUNT(vid) FROM {node_revision} WHERE nid = :nid and vid = :vid', [':nid' => $node->id(), ':vid' => $nodes[1]->getRevisionId()])->fetchField() == 0, 'Revision not found.');
$this->assertTrue($connection->query('SELECT COUNT(vid) FROM {node_field_revision} WHERE nid = :nid and vid = :vid', [':nid' => $node->id(), ':vid' => $nodes[1]->getRevisionId()])->fetchField() == 0, 'Field revision not found.');
$nids = \Drupal::entityQuery('node')
->accessCheck(FALSE)
->allRevisions()
->condition('nid', $node->id())
->condition('vid', $nodes[1]->getRevisionId())
->execute();
$this->assertCount(0, $nids);

// Set the revision timestamp to an older date to make sure that the
// confirmation message correctly displays the stored revision date.
Expand Down

0 comments on commit 0ce2b9b

Please sign in to comment.