You are here

public function EntityRevisionConverterTest::testConvertNonRevisionableEntityType in Workbench Moderation 8

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/EntityRevisionConverterTest.php \Drupal\Tests\workbench_moderation\Kernel\EntityRevisionConverterTest::testConvertNonRevisionableEntityType()

Test converting non-revisionable entity type.

File

tests/src/Kernel/EntityRevisionConverterTest.php, line 47

Class

EntityRevisionConverterTest
@coversDefaultClass \Drupal\workbench_moderation\ParamConverter\EntityRevisionConverter @group workbench_moderation

Namespace

Drupal\Tests\workbench_moderation\Kernel

Code

public function testConvertNonRevisionableEntityType() {
  $entity_test = EntityTest::create([
    'name' => 'test',
  ]);
  $entity_test
    ->save();

  /** @var \Symfony\Component\Routing\RouterInterface $router */
  $router = \Drupal::service('router.no_access_checks');
  $result = $router
    ->match('/entity_test/' . $entity_test
    ->id());
  $this
    ->assertInstanceOf(EntityTest::class, $result['entity_test']);
  $this
    ->assertEquals($entity_test
    ->getRevisionId(), $result['entity_test']
    ->getRevisionId());
}