Veejayspb /
jsonrpc
| 1 | <?php |
||
| 2 | |||
| 3 | use Codeception\Test\Unit; |
||
| 4 | use veejay\jsonrpc\batch\Response; |
||
| 5 | use veejay\jsonrpc\tests\Api; |
||
| 6 | use veejay\jsonrpc\tests\ProtectedHelper; |
||
| 7 | |||
| 8 | class ApiTest extends Unit |
||
| 9 | { |
||
| 10 | public function testCall() |
||
| 11 | { |
||
| 12 | $api = new Api; |
||
| 13 | |||
| 14 | $code = ProtectedHelper::catchExceptionCode(function () use ($api) { |
||
| 15 | $api->withoutParams(); |
||
| 16 | }); |
||
| 17 | $this->assertEquals(0, $code); |
||
| 18 | |||
| 19 | $code = ProtectedHelper::catchExceptionCode(function () use ($api) { |
||
| 20 | $api->notExisted(); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 21 | }); |
||
| 22 | $this->assertEquals(Response::METHOD_NOT_FOUND, $code); |
||
| 23 | } |
||
| 24 | } |
||
| 25 |