예제 #1
0
 /**
  * Tests the getFormObject() method with an invalid operation.
  *
  * @covers ::getFormObject
  *
  * @expectedException \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
  */
 public function testGetFormObjectInvalidOperation()
 {
     $entity = $this->getMock('Drupal\\Core\\Entity\\EntityTypeInterface');
     $entity->expects($this->once())->method('getFormClass')->with('edit')->will($this->returnValue(''));
     $this->setUpEntityManager(array('test_entity_type' => $entity));
     $this->entityManager->getFormObject('test_entity_type', 'edit');
 }
예제 #2
0
 /**
  * Tests the getFormObject() method with an invalid operation.
  *
  * @covers ::getFormObject
  *
  * @expectedException \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
  */
 public function testGetFormObjectInvalidOperation()
 {
     $entity = $this->prophesize(EntityTypeInterface::class);
     $entity->getFormClass('edit')->willReturn('');
     $this->setUpEntityManager(array('test_entity_type' => $entity));
     $this->entityManager->getFormObject('test_entity_type', 'edit');
 }