You are here

public function MetatagTokenTest::setUp in Metatag 8

Overrides BrowserTestBase::setUp

File

tests/src/Functional/MetatagTokenTest.php, line 40

Class

MetatagTokenTest
Verify that metatag token generation is working.

Namespace

Drupal\Tests\metatag\Functional

Code

public function setUp() : void {
  parent::setUp();
  $this
    ->drupalPlaceBlock('system_breadcrumb_block');
  $this
    ->drupalPlaceBlock('local_tasks_block');
  $this
    ->drupalPlaceBlock('page_title_block');
  $this
    ->drupalLogin($this->rootUser);
  $this
    ->fieldUIAddNewField('/admin/config/people/accounts', 'metatags', 'Metatags', 'metatag');

  // This extra step is necessary due to changes in core that removed a cache
  // invalidation step.
  // @see https://www.drupal.org/project/drupal/issues/2189411
  $this->container
    ->get('entity_field.manager')
    ->clearCachedFieldDefinitions();
}