You are here

protected function MetaInformationTest::checkSavedConfiguration in Thunder 8.2

Same name and namespace in other branches
  1. 8.5 tests/src/FunctionalJavascript/MetaInformationTest.php \Drupal\Tests\thunder\FunctionalJavascript\MetaInformationTest::checkSavedConfiguration()
  2. 8.3 tests/src/FunctionalJavascript/MetaInformationTest.php \Drupal\Tests\thunder\FunctionalJavascript\MetaInformationTest::checkSavedConfiguration()
  3. 8.4 tests/src/FunctionalJavascript/MetaInformationTest.php \Drupal\Tests\thunder\FunctionalJavascript\MetaInformationTest::checkSavedConfiguration()
  4. 6.2.x tests/src/FunctionalJavascript/MetaInformationTest.php \Drupal\Tests\thunder\FunctionalJavascript\MetaInformationTest::checkSavedConfiguration()
  5. 6.0.x tests/src/FunctionalJavascript/MetaInformationTest.php \Drupal\Tests\thunder\FunctionalJavascript\MetaInformationTest::checkSavedConfiguration()
  6. 6.1.x tests/src/FunctionalJavascript/MetaInformationTest.php \Drupal\Tests\thunder\FunctionalJavascript\MetaInformationTest::checkSavedConfiguration()

Check saved configuration on meta tag overview page.

Parameters

string $configurationUrl: Url to page where configuration should be set.

array $configuration: List of configuration what will be set for meta tag.

1 call to MetaInformationTest::checkSavedConfiguration()
MetaInformationTest::testArticleMetaTags in tests/src/FunctionalJavascript/MetaInformationTest.php
Test Meta Tag default configuration and custom configuration for article.

File

tests/src/FunctionalJavascript/MetaInformationTest.php, line 146

Class

MetaInformationTest
Testing of Meta Information.

Namespace

Drupal\Tests\thunder\FunctionalJavascript

Code

protected function checkSavedConfiguration($configurationUrl, array $configuration) {
  $this
    ->drupalGet('admin/config/search/metatag');
  $page = $this
    ->getSession()
    ->getPage();
  $this
    ->expandAllTabs();
  foreach ($configuration as $metaTagName => $metaTagValue) {
    $metaTag = explode(' ', $metaTagName);
    $fieldName = $this
      ->getMetaTagFieldName($metaTag[1]);
    $this
      ->assertNotEquals(NULL, $page
      ->find('xpath', '//tr[.//a[contains(@href, "/' . $configurationUrl . '")]]/td[1]//table//tr[./td[text()="' . $fieldName . ':"] and ./td[text()="' . $metaTagValue . '"]]'));
  }
}