You are here

public function MetatagPanelsTest::testExportedPage in Metatag 7

Test the Panels integration.

File

metatag_panels/tests/MetatagPanelsTest.test, line 45
Tests for the Metatag module for the direct Panels integration.

Class

MetatagPanelsTest
Tests for the Metatag module for the direct Panels integration.

Code

public function testExportedPage() {
  $this
    ->drupalGet('metatag-panels-test');
  $this
    ->assertResponse(200);

  // Test the page title.
  $this
    ->assertTitle('Test page title');

  // Test the description meta tag.
  $xpath = $this
    ->xpath("//meta[@name='description']");
  $this
    ->assertEqual(count($xpath), 1, 'Exactly one description meta tag found.');
  $this
    ->assertEqual($xpath[0]['content'], 'Test page description.');

  // Test the keywords meta tag.
  $xpath = $this
    ->xpath("//meta[@name='keywords']");
  $this
    ->assertEqual(count($xpath), 1, 'Exactly one keywords meta tag found.');
  $this
    ->assertEqual($xpath[0]['content'], 'Test, page, keywords');

  // Test the abstract meta tag.
  $xpath = $this
    ->xpath("//meta[@name='abstract']");
  $this
    ->assertEqual(count($xpath), 1, 'Exactly one abstract meta tag found.');
  $this
    ->assertEqual($xpath[0]['content'], 'http://www.example.com/user/1/full-bio-(1).pdf');
}