Skip to content
Snippets Groups Projects
Commit c01dafd6 authored by catch's avatar catch
Browse files

Issue #1361234 by Berdir: Make the node entity a classed object - followup for...

Issue #1361234 by Berdir: Make the node entity a classed object - followup for node revision timestamps.
parent 1fa5a5b1
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -231,6 +231,22 @@ class NodeRevisionsTestCase extends NodeWebTestCase {
array('%revision-date' => format_date($nodes[1]->revision_timestamp),
'@type' => 'Basic page', '%title' => $nodes[1]->title)), t('Revision deleted.'));
$this->assertTrue(db_query('SELECT COUNT(vid) FROM {node_revision} WHERE nid = :nid and vid = :vid', array(':nid' => $node->nid, ':vid' => $nodes[1]->vid))->fetchField() == 0, t('Revision not found.'));
// Set the revision timestamp to an older date to make sure that the
// confirmation message correctly displays the stored revision date.
$old_revision_date = REQUEST_TIME - 86400;
db_update('node_revision')
->condition('vid', $nodes[2]->vid)
->fields(array(
'timestamp' => $old_revision_date,
))
->execute();
$this->drupalPost("node/$node->nid/revisions/{$nodes[2]->vid}/revert", array(), t('Revert'));
$this->assertRaw(t('@type %title has been reverted back to the revision from %revision-date.', array(
'@type' => 'Basic page',
'%title' => $nodes[2]->title,
'%revision-date' => format_date($old_revision_date),
)));
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment