You are here

public function ResourceResponseValidatorTest::testValidateResponse in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/tests/src/Unit/EventSubscriber/ResourceResponseValidatorTest.php \Drupal\Tests\jsonapi\Unit\EventSubscriber\ResourceResponseValidatorTest::testValidateResponse()
  2. 9 core/modules/jsonapi/tests/src/Unit/EventSubscriber/ResourceResponseValidatorTest.php \Drupal\Tests\jsonapi\Unit\EventSubscriber\ResourceResponseValidatorTest::testValidateResponse()

@covers ::validateResponse @dataProvider validateResponseProvider

File

core/modules/jsonapi/tests/src/Unit/EventSubscriber/ResourceResponseValidatorTest.php, line 102

Class

ResourceResponseValidatorTest
@coversDefaultClass \Drupal\jsonapi\EventSubscriber\ResourceResponseValidator @group jsonapi

Namespace

Drupal\Tests\jsonapi\Unit\EventSubscriber

Code

public function testValidateResponse($request, $response, $expected, $description) {

  // Expose protected ResourceResponseSubscriber::validateResponse() method.
  $object = new \ReflectionObject($this->subscriber);
  $method = $object
    ->getMethod('validateResponse');
  $method
    ->setAccessible(TRUE);
  $this
    ->assertSame($expected, $method
    ->invoke($this->subscriber, $response, $request), $description);
}