1 node.test public NodeLayoutRevisionTestCase::setUp()

Sets up test case.

Overrides BackdropWebTestCase::setUp

File

core/modules/node/tests/node.test, line 1008
Tests for node.module.

Class

NodeLayoutRevisionTestCase
Tests that the correct layout is used for node revisions.

Code

public function setUp() {
  parent::setUp('node_layout_preview_revision_test');

  // Create and login user.
  $web_user = $this->backdropCreateUser(array(
    'view revisions',
  ));
  $this->backdropLogin($web_user);
  $nodes = array();

  // Create initial node.
  $node = $this->backdropCreateNode();
  $settings = get_object_vars($node);
  $settings['revision'] = 1;
  $settings['is_active_revision'] = TRUE;
  $nodes[] = $node;

  // Create a revision with random title and body and update variables.
  $this->backdropCreateNode($settings);
  // Make sure we get revision information.
  $node = node_load($node->nid);
  $settings = get_object_vars($node);
  $settings['is_active_revision'] = TRUE;
  $nodes[] = $node;

  $this->nodes = $nodes;
}