You are here

public function DefaultTags::testFrontpage in Metatag 8

Test the default values for the front page.

File

tests/src/Functional/DefaultTags.php, line 61

Class

DefaultTags
Verify that the configured defaults load as intended.

Namespace

Drupal\Tests\metatag\Functional

Code

public function testFrontpage() {
  $this
    ->drupalGet('<front>');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $xpath = $this
    ->xpath("//link[@rel='canonical']");
  $this_page_url = $this
    ->buildUrl('<front>');
  self::assertEquals((string) $xpath[0]
    ->getAttribute('href'), $this_page_url);
}