function ResourceResponseValidatorTest::testValidateResponse

Same name in other branches
  1. 8.9.x core/modules/jsonapi/tests/src/Unit/EventSubscriber/ResourceResponseValidatorTest.php \Drupal\Tests\jsonapi\Unit\EventSubscriber\ResourceResponseValidatorTest::testValidateResponse()
  2. 10 core/modules/jsonapi/tests/src/Unit/EventSubscriber/ResourceResponseValidatorTest.php \Drupal\Tests\jsonapi\Unit\EventSubscriber\ResourceResponseValidatorTest::testValidateResponse()
  3. 11.x 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);
}

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