You are here

public function MetatagContextTest::testNode in Metatag 7

Test handling a node.

File

metatag_context/tests/MetatagContextTest.test, line 58
Functional tests for the Metatag:Context module.

Class

MetatagContextTest
Functional tests for the Metatag:Context module.

Code

public function testNode() {

  // Create a node.
  $this
    ->drupalPost('node/add/' . $this->hyphen_type, array(
    'title' => $this
      ->randomName(8),
  ), t('Save'));
  $this
    ->assertResponse(200);

  // Generate metatags and check content.
  $test_object = $this
    ->createTestObject('node_metatags', 'node/1');
  $this
    ->generateByPathConfig($test_object);
  $this
    ->editByPathConfig($test_object);
  $this
    ->checkByPathConfig($test_object);

  // Edit metatag and check content.
  $test_object->title = 'New title';
  $test_object->description = '';
  $this
    ->editByPathConfig($test_object);
  $this
    ->checkByPathConfig($test_object);
}