/** * Sets up the storage accessed via the entity type manager in the form. * * @return \Prophecy\Prophecy\ObjectProphecy * The storage prophecy. */ protected function setUpStorage() { $storage = $this->prophesize(EntityStorageInterface::class); $entity_type_manager = $this->prophesize(EntityTypeManagerInterface::class); $entity_type_manager->getDefinition($this->entityType->id())->willReturn($this->entityType); $entity_type_manager->getStorage($this->entityType->id())->willReturn($storage->reveal()); $this->entityForm->setEntityTypeManager($entity_type_manager->reveal()); return $storage; }