/** * 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' */ 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'); }