function EntityFieldManagerTest::testClearCachedFieldDefinitions

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php \Drupal\Tests\Core\Entity\EntityFieldManagerTest::testClearCachedFieldDefinitions()
  2. 8.9.x core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php \Drupal\Tests\Core\Entity\EntityFieldManagerTest::testClearCachedFieldDefinitions()
  3. 11.x core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php \Drupal\Tests\Core\Entity\EntityFieldManagerTest::testClearCachedFieldDefinitions()

Tests the clearCachedFieldDefinitions() method.

@covers ::clearCachedFieldDefinitions

File

core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php, line 649

Class

EntityFieldManagerTest
@coversDefaultClass \Drupal\Core\Entity\EntityFieldManager @group Entity

Namespace

Drupal\Tests\Core\Entity

Code

public function testClearCachedFieldDefinitions() : void {
    $this->setUpEntityTypeDefinitions();
    $this->cacheTagsInvalidator
        ->invalidateTags([
        'entity_field_info',
    ])
        ->shouldBeCalled();
    $this->container
        ->get('cache_tags.invalidator')
        ->willReturn($this->cacheTagsInvalidator
        ->reveal())
        ->shouldBeCalled();
    $this->typedDataManager
        ->clearCachedDefinitions()
        ->shouldBeCalled();
    $this->entityFieldManager
        ->clearCachedFieldDefinitions();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.