You are here

protected function YoastSeoTest::disableYoastSeo in Real-time SEO for Drupal 8

Disable Yoast SEO for a given bundle.

1 call to YoastSeoTest::disableYoastSeo()
YoastSeoTest::testYoastSeoEnabledDisabled in src/Tests/YoastSeoTest.php
Only available when it has been previously enabled on the content type.

File

src/Tests/YoastSeoTest.php, line 79

Class

YoastSeoTest
Ensures that the Yoast Seo works correctly.

Namespace

Drupal\yoast_seo\Tests

Code

protected function disableYoastSeo($entity_type, $bundle) {

  // Configure yoast seo for the given bundle.
  $this
    ->drupalGet('admin/config/yoast_seo');
  $edit = [
    $entity_type . '[' . $bundle . ']' => FALSE,
  ];
  json_decode($this
    ->drupalPostForm(NULL, $edit, t('Save')));
  $this
    ->assertSession()
    ->checkboxNotChecked('edit-node-page');
}