You are here

function NodeRevisionsTest::testRevisionRevert in SimpleTest 6

Simpletest test. Tests to make sure the that revisions revert properly.

File

tests/node_revisions.test, line 76

Class

NodeRevisionsTest

Code

function testRevisionRevert() {
  extract($this
    ->prepareRevisions());
  $test_user = $this
    ->drupalCreateUserRolePerm(array(
    'revert revisions',
    'edit any page content',
  ));
  $this
    ->drupalLoginUser($test_user);
  $this
    ->drupalPost("node/{$node->nid}/revisions/{$vid}/revert", array(), 'Revert');
  $newnode = node_load($node->nid);
  $this
    ->assertTrue($text == $newnode->body, 'Check to make sure reversions occur properly');
  $this
    ->cleanup($node->nid);
}