You are here

public function EntityConverterTest::testConvertWithInvalidDynamicEntityType in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php \Drupal\Tests\Core\ParamConverter\EntityConverterTest::testConvertWithInvalidDynamicEntityType()

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

File

core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php, line 344

Class

EntityConverterTest
@coversDefaultClass \Drupal\Core\ParamConverter\EntityConverter @group ParamConverter @group Entity

Namespace

Drupal\Tests\Core\ParamConverter

Code

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