public function EntityFormTest::testGetEntityFromRouteMatchEditDelete in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php \Drupal\Tests\Core\Entity\EntityFormTest::testGetEntityFromRouteMatchEditDelete()
- 9 core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php \Drupal\Tests\Core\Entity\EntityFormTest::testGetEntityFromRouteMatchEditDelete()
Tests EntityForm::getEntityFromRouteMatch() for edit and delete forms.
@covers ::getEntityFromRouteMatch
File
- core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityFormTest.php, line 141
Class
- EntityFormTest
- @coversDefaultClass \Drupal\Core\Entity\EntityForm @group Entity
Namespace
Drupal\Tests\Core\EntityCode
public function testGetEntityFromRouteMatchEditDelete() {
$entity = $this
->prophesize(EntityInterface::class)
->reveal();
$id = $this->entityType
->id();
$route_match = new RouteMatch('test_route', new Route('/entity-test/manage/{' . $id . '}/edit'), [
$id => $entity,
], [
$id => 1,
]);
$actual = $this->entityForm
->getEntityFromRouteMatch($route_match, $id);
$this
->assertEquals($entity, $actual);
}