You are here

public function EntityTypeManagerTest::testProcessDefinition in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php \Drupal\Tests\Core\Entity\EntityTypeManagerTest::testProcessDefinition()

Tests the processDefinition() method.

@covers ::processDefinition

@expectedException \Drupal\Core\Entity\Exception\InvalidLinkTemplateException @expectedExceptionMessage Link template 'canonical' for entity type 'apple' must start with a leading slash, the current link template is 'path/to/apple'

File

core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php, line 321
Contains \Drupal\Tests\Core\Entity\EntityTypeManagerTest.

Class

EntityTypeManagerTest
@coversDefaultClass \Drupal\Core\Entity\EntityTypeManager @group Entity

Namespace

Drupal\Tests\Core\Entity

Code

public function testProcessDefinition() {
  $apple = $this
    ->prophesize(EntityTypeInterface::class);
  $this
    ->setUpEntityTypeDefinitions([
    'apple' => $apple,
  ]);
  $apple
    ->getLinkTemplates()
    ->willReturn([
    'canonical' => 'path/to/apple',
  ]);
  $definition = $apple
    ->reveal();
  $this->entityTypeManager
    ->processDefinition($definition, 'apple');
}