function EntityFieldManagerTest::testGetBaseFieldDefinitionsInvalidDefinition

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

Tests the getBaseFieldDefinitions() method with an invalid definition.

@covers ::getBaseFieldDefinitions @covers ::buildBaseFieldDefinitions

File

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

Class

EntityFieldManagerTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Entity%21EntityFieldManager.php/class/EntityFieldManager/10" title="Manages the discovery of entity fields." class="local">\Drupal\Core\Entity\EntityFieldManager</a> @group Entity

Namespace

Drupal\Tests\Core\Entity

Code

public function testGetBaseFieldDefinitionsInvalidDefinition() {
    $this->setUpEntityWithFieldDefinition(FALSE, 'langcode', [
        'langcode' => 'langcode',
    ]);
    $this->entityType
        ->isTranslatable()
        ->willReturn(TRUE);
    $this->entityType
        ->getLabel()
        ->willReturn('the_label');
    $this->expectException(\LogicException::class);
    $this->entityFieldManager
        ->getBaseFieldDefinitions('test_entity_type');
}

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