You are here

MetatagTokenStatus.php in Metatag 8

File

tests/src/Functional/MetatagTokenStatus.php
View source
<?php

namespace Drupal\Tests\metatag\Functional;

use Drupal\Core\Url;
use Drupal\Tests\BrowserTestBase;

/**
 * Test the token status for metatag.
 *
 * @group metatag
 */
class MetatagTokenStatus extends BrowserTestBase {

  /**
   * {@inheritdoc}
   */
  public static $modules = [
    'metatag',
  ];

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';

  /**
   * Test the status report does not contain warnings about types.
   *
   * @see token_get_token_problems
   */
  function testStatusReportTypesWarning() {
    $this
      ->drupalLogin($this->rootUser);
    $this
      ->drupalGet(Url::fromRoute('system.status'));
    $this
      ->assertSession()
      ->pageTextNotContains('$info[\'types\'][\'metatag');
  }

  /**
   * Test the status report does not contain warnings about tokens.
   *
   * @see token_get_token_problems
   */
  function testStatusReportTokensWarning() {
    $this
      ->drupalLogin($this->rootUser);
    $this
      ->drupalGet(Url::fromRoute('system.status'));
    $this
      ->assertSession()
      ->pageTextNotContains('$info[\'tokens\'][\'metatag');
  }

}

Classes

Namesort descending Description
MetatagTokenStatus Test the token status for metatag.