public function NavigationalStructureTest::entityEdit in Entity Construction Kit (ECK) 8
Tests entity editing.
@test
Throws
\Drupal\Core\Entity\EntityStorageException
File
- tests/
src/ Functional/ NavigationalStructureTest.php, line 527
Class
- NavigationalStructureTest
- Test Entity Construction Kit's navigational structure.
Namespace
Drupal\Tests\eck\FunctionalCode
public function entityEdit() {
$entityTitle = $this
->randomString();
$entity = $this
->getEntityStorageHandler()
->create([
'type' => $this->entityBundleMachineName,
'title' => $entityTitle,
]);
$entity
->save();
$route = "entity.{$this->entityTypeMachineName}.edit_form";
$routeArguments = [
$this->entityTypeMachineName => $entity
->id(),
];
$expectedUrl = "{$this->entityTypeMachineName}/{$entity->id()}/edit";
$expectedTitle = "Edit {$this->entityBundleLabel} {$entityTitle}";
$this->baseCrumbs = [
'Home',
];
$crumbs = [
$entityTitle,
];
$this
->assertCorrectPageOnRoute($route, $routeArguments, $expectedUrl, $expectedTitle, $crumbs);
}