function EntityRevisionParamConverterTest::testConvertWithInvalidDynamicEntityType

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/Core/ParamConverter/EntityRevisionParamConverterTest.php \Drupal\Tests\Core\ParamConverter\EntityRevisionParamConverterTest::testConvertWithInvalidDynamicEntityType()
  2. 9 core/tests/Drupal/Tests/Core/ParamConverter/EntityRevisionParamConverterTest.php \Drupal\Tests\Core\ParamConverter\EntityRevisionParamConverterTest::testConvertWithInvalidDynamicEntityType()
  3. 8.9.x core/tests/Drupal/Tests/Core/ParamConverter/EntityRevisionParamConverterTest.php \Drupal\Tests\Core\ParamConverter\EntityRevisionParamConverterTest::testConvertWithInvalidDynamicEntityType()

Tests the convert() method with an invalid dynamic entity type ID.

File

core/tests/Drupal/Tests/Core/ParamConverter/EntityRevisionParamConverterTest.php, line 148

Class

EntityRevisionParamConverterTest
Tests Drupal\Core\ParamConverter\EntityRevisionParamConverter.

Namespace

Drupal\Tests\Core\ParamConverter

Code

public function testConvertWithInvalidDynamicEntityType() : void {
  $this->expectException(ParamNotConvertedException::class);
  $this->expectExceptionMessage('The "foo" parameter was not converted because the "invalid_entity_type_id" parameter is missing.');
  $this->converter
    ->convert('valid_id', [
    'type' => 'entity_revision:{invalid_entity_type_id}',
  ], 'foo', [
    'foo' => 'valid_id',
  ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.