You are here

public function ResponseHeadersTest::testInvalidSchema in JSON-RPC 2.x

Ensures that a response not matching the schema produces invalid results.

File

tests/src/Functional/ResponseHeadersTest.php, line 60

Class

ResponseHeadersTest
Test turning the maintenance mode on or off using JSON RPC.

Namespace

Drupal\Tests\jsonrpc\Functional

Code

public function testInvalidSchema() {
  $request = [
    'jsonrpc' => '2.0',
    'method' => 'third.test',
    'id' => 'third',
  ];
  $response = $this
    ->postRpc($request);
  $contents = $response
    ->getBody();
  $this
    ->assertSame(-32603, Json::decode($contents)['error']['code']);
}