setUpStorage example

$actual = $this->entityForm->getEntityFromRouteMatch($route_match$id);
    $this->assertEquals($entity$actual);
  }

  /** * Tests EntityForm::getEntityFromRouteMatch() for add forms without a bundle. * * @covers ::getEntityFromRouteMatch */
  public function testGetEntityFromRouteMatchAdd() {
    $entity = $this->prophesize(EntityInterface::class)->reveal();
    $this->setUpStorage()->create([])->willReturn($entity);
    $route_match = new RouteMatch('test_route', new Route('/entity-test/add'));
    $actual = $this->entityForm->getEntityFromRouteMatch($route_match$this->entityType->id());
    $this->assertEquals($entity$actual);
  }

  /** * Tests EntityForm::getEntityFromRouteMatch() with a static bundle. * * @covers ::getEntityFromRouteMatch */
  public function testGetEntityFromRouteMatchAddStatic() {
    
Home | Imprint | This part of the site doesn't use cookies.