You are here

public function ModuleIntegrationTest::testFacebookMetaTags in Thunder 6.2.x

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

Testing integration of "metatag_facebook" module.

File

tests/src/FunctionalJavascript/ModuleIntegrationTest.php, line 179

Class

ModuleIntegrationTest
Testing of module integrations.

Namespace

Drupal\Tests\thunder\FunctionalJavascript

Code

public function testFacebookMetaTags() {
  $facebookMetaTags = $this
    ->generateMetaTagConfiguration([
    [
      'facebook fb:admins' => 'zuck',
      'facebook fb:pages' => 'some-fancy-fb-page-url',
      'facebook fb:app_id' => '1121151812167212,1121151812167213',
    ],
  ]);

  // Create Article with facebook meta tags and check it.
  $fieldValues = $this
    ->generateMetaTagFieldValues($facebookMetaTags, 'field_meta_tags[0]');
  $term = $this
    ->loadTermByUuid('bfc251bc-de35-467d-af44-1f7a7012b845');
  $fieldValues += [
    'field_channel' => $term
      ->id(),
    'title[0][value]' => 'Test FB MetaTags Article',
    'field_seo_title[0][value]' => 'Facebook MetaTags',
    'field_teaser_text[0][value]' => 'Facebook MetaTags Testing',
  ];
  $this
    ->articleFillNew($fieldValues);
  $this
    ->clickSave();
  $this
    ->checkMetaTags($facebookMetaTags);
}