function ResourceResponseValidatorTest::testValidateResponse

Tests validate response.

@legacy-covers ::validateResponse

Attributes

#[DataProvider('validateResponseProvider')]

File

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

Class

ResourceResponseValidatorTest
Tests Drupal\jsonapi\EventSubscriber\ResourceResponseValidator.

Namespace

Drupal\Tests\jsonapi\Unit\EventSubscriber

Code

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

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