public function EntityTypeTest::testGetKey in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php \Drupal\Tests\Core\Entity\EntityTypeTest::testGetKey()
- 10 core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php \Drupal\Tests\Core\Entity\EntityTypeTest::testGetKey()
Tests the getKey() method.
@dataProvider providerTestGetKeys
File
- core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityTypeTest.php, line 76
Class
- EntityTypeTest
- @coversDefaultClass \Drupal\Core\Entity\EntityType @group Entity
Namespace
Drupal\Tests\Core\EntityCode
public function testGetKey($entity_keys, $expected) {
$entity_type = $this
->setUpEntityType([
'entity_keys' => $entity_keys,
]);
$this
->assertSame($expected['bundle'], $entity_type
->getKey('bundle'));
$this
->assertSame(FALSE, $entity_type
->getKey('bananas'));
}