function EntityTypeTest::testGetKeys

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

Tests the getKeys() method.

@dataProvider providerTestGetKeys

File

core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php, line 63

Class

EntityTypeTest
@coversDefaultClass \Drupal\Core\Entity\EntityType @group Entity

Namespace

Drupal\Tests\Core\Entity

Code

public function testGetKeys($entity_keys, $expected) : void {
    $entity_type = $this->setUpEntityType([
        'entity_keys' => $entity_keys,
    ]);
    $expected += [
        'default_langcode' => 'default_langcode',
        'revision_translation_affected' => 'revision_translation_affected',
    ];
    $this->assertSame($expected, $entity_type->getKeys());
}

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