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
......@@ -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),
)));
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment