/** * Tests the getHandler() method when no controller is defined. * * @covers ::getHandler * * @expectedException \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException */ public function testGetHandlerMissingHandler() { $entity = $this->getMock('Drupal\\Core\\Entity\\EntityTypeInterface'); $entity->expects($this->once())->method('getHandlerClass')->with('storage')->will($this->returnValue('')); $this->setUpEntityManager(array('test_entity_type' => $entity)); $this->entityManager->getHandler('test_entity_type', 'storage'); }
/** * Tests the getHandler() method when no controller is defined. * * @covers ::getHandler * * @expectedException \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException */ public function testGetHandlerMissingHandler() { $entity = $this->prophesize(EntityTypeInterface::class); $entity->getHandlerClass('storage')->willReturn(''); $this->setUpEntityManager(array('test_entity_type' => $entity)); $this->entityManager->getHandler('test_entity_type', 'storage'); }