1 node_example.test public NodeExampleTestCase::testBodyLabel()

Check the value of body label.

Checks whether body label has a value of "Example Description"

File

modules/examples/node_example/node_example.test, line 93
Simpletest case for node_example module.

Class

NodeExampleTestCase
Functionality tests for node example module.

Code

public function testBodyLabel() {
  // Create and login user.
  $account = $this->backdropCreateUser(array('access content', 'create node_example content'));
  $this->backdropLogin($account);

  // Request a node add node-example page.
  // Test whether the body label equals 'Example Description'.
  // Use '$this->assertRaw' to make certain to test the body label and not
  // some other text.
  $this->backdropGet('node/add/node-example');
  $this->assertResponse(200, 'node/add/node-example page found');
  $this->assertRaw('<label for="edit-body-und-0-value">Example Description </label>', 'Body label equals \'Example Description\'');
}