public function EntityRevisionParamConverterTest::testConvert in Entity API 8.0
@covers ::convert
File
- tests/
src/ Unit/ ParamConverter/ EntityRevisionParamConverterTest.php, line 75 - Contains \Drupal\Tests\entity\Unit\ParamConverter\EntityRevisionParamConverterTest.
Class
- EntityRevisionParamConverterTest
- @coversDefaultClass \Drupal\entity\ParamConverter\EntityRevisionParamConverter @group entity
Namespace
Drupal\Tests\entity\Unit\ParamConverterCode
public function testConvert() {
$entity = $this
->prophesize(EntityInterface::class)
->reveal();
$storage = $this
->prophesize(EntityStorageInterface::class);
$storage
->loadRevision(1)
->willReturn($entity);
$entity_type_manager = $this
->prophesize(EntityTypeManagerInterface::class);
$entity_type_manager
->getStorage('test')
->willReturn($storage
->reveal());
$converter = new EntityRevisionParamConverter($entity_type_manager
->reveal());
$route = $this
->getTestRoute();
$converter
->convert(1, $route
->getOption('parameters')['test_revision'], 'test_revision', [
'test_revision' => 1,
]);
}