'2.0', 'id' => 1, 'error' => [ 'code' => -32602, 'message' => 'Another error occurred', ], ]; $this->assertSame($expected, $error->jsonSerialize()); } public function testWithStringId(): void { $error = new Error('abc', -32602, 'Another error occurred'); $expected = [ 'jsonrpc' => '2.0', 'id' => 'abc', 'error' => [ 'code' => -32602, 'message' => 'Another error occurred', ], ]; $this->assertSame($expected, $error->jsonSerialize()); } }