function ResourceTestBase::assertResponseWhenMissingAuthentication

Same name in other branches
  1. 9 core/modules/rest/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\rest\Functional\ResourceTestBase::assertResponseWhenMissingAuthentication()
  2. 8.9.x core/modules/rest/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\rest\Functional\ResourceTestBase::assertResponseWhenMissingAuthentication()
  3. 10 core/modules/rest/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\rest\Functional\ResourceTestBase::assertResponseWhenMissingAuthentication()

Verifies the error response in case of missing authentication.

Parameters

string $method: HTTP method.

\Psr\Http\Message\ResponseInterface $response: The response to assert.

4 calls to ResourceTestBase::assertResponseWhenMissingAuthentication()
EntityResourceTestBase::testDelete in core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php
Tests a DELETE request for an entity, plus edge cases to ensure good DX.
EntityResourceTestBase::testGet in core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php
Tests a GET request for an entity, plus edge cases to ensure good DX.
EntityResourceTestBase::testPatch in core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php
Tests a PATCH request for an entity, plus edge cases to ensure good DX.
EntityResourceTestBase::testPost in core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php
Tests a POST request for an entity, plus edge cases to ensure good DX.

File

core/modules/rest/tests/src/Functional/ResourceTestBase.php, line 227

Class

ResourceTestBase
Subclass this for every REST resource, every format and every auth provider.

Namespace

Drupal\Tests\rest\Functional

Code

protected abstract function assertResponseWhenMissingAuthentication($method, ResponseInterface $response);

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