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