|
@@ 47-62 (lines=16) @@
|
| 44 |
|
$this->assertNull($response); |
| 45 |
|
} |
| 46 |
|
|
| 47 |
|
public function testAsyncNotifyRequest() |
| 48 |
|
{ |
| 49 |
|
$method = 'notify'; |
| 50 |
|
$params = ['foo'=>true]; |
| 51 |
|
$request = $this->client->notification($method, $params); |
| 52 |
|
$this->promise = $this->client->sendAsync($request); |
| 53 |
|
|
| 54 |
|
$this->promise->then(function ($response) use ($request, $method, $params) { |
| 55 |
|
$this->assertEquals(ClientInterface::SPEC, $request->getRpcVersion()); |
| 56 |
|
$this->assertEquals(null, $request->getRpcId()); |
| 57 |
|
$this->assertEquals($method, $request->getRpcMethod()); |
| 58 |
|
$this->assertEquals($params, $request->getRpcParams()); |
| 59 |
|
|
| 60 |
|
$this->assertNull($response); |
| 61 |
|
}); |
| 62 |
|
} |
| 63 |
|
|
| 64 |
|
public function testNotifyRequestWithInvalidParams() |
| 65 |
|
{ |
|
@@ 79-94 (lines=16) @@
|
| 76 |
|
$this->assertNull($response); |
| 77 |
|
} |
| 78 |
|
|
| 79 |
|
public function testAsyncNotifyRequestWithInvalidParams() |
| 80 |
|
{ |
| 81 |
|
$method = 'notify'; |
| 82 |
|
$params = ['foo'=>'bar']; |
| 83 |
|
$request = $this->client->notification($method, $params); |
| 84 |
|
$this->promise = $this->client->sendAsync($request); |
| 85 |
|
|
| 86 |
|
$this->promise->then(function ($response) use ($request, $method, $params) { |
| 87 |
|
$this->assertEquals(ClientInterface::SPEC, $request->getRpcVersion()); |
| 88 |
|
$this->assertEquals(null, $request->getRpcId()); |
| 89 |
|
$this->assertEquals($method, $request->getRpcMethod()); |
| 90 |
|
$this->assertEquals($params, $request->getRpcParams()); |
| 91 |
|
|
| 92 |
|
$this->assertNull($response); |
| 93 |
|
}); |
| 94 |
|
} |
| 95 |
|
} |
| 96 |
|
|