You are here

public function MessageResourceTestBase::testGet in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/contact/tests/src/Functional/Rest/MessageResourceTestBase.php \Drupal\Tests\contact\Functional\Rest\MessageResourceTestBase::testGet()

Test a GET request for an entity, plus edge cases to ensure good DX.

Overrides EntityResourceTestBase::testGet

File

core/modules/contact/tests/src/Functional/Rest/MessageResourceTestBase.php, line 117

Class

MessageResourceTestBase

Namespace

Drupal\Tests\contact\Functional\Rest

Code

public function testGet() {

  // Contact Message entities are not stored, so they cannot be retrieved.
  $this
    ->expectException(RouteNotFoundException::class);
  $this
    ->expectExceptionMessage('Route "rest.entity.contact_message.GET" does not exist.');
  $this
    ->provisionEntityResource();
  Url::fromRoute('rest.entity.contact_message.GET')
    ->toString(TRUE);
}