mirror of
https://github.com/Karaka-Management/oms-OnlineResourceWatcher.git
synced 2026-02-16 07:58:41 +00:00
add invalid api function tests
This commit is contained in:
parent
00b7801c9d
commit
d5e42737f0
|
|
@ -108,4 +108,24 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|
||||||
self::assertGreaterThan(0, $response->getDataArray('')['response']->id);
|
self::assertGreaterThan(0, $response->getDataArray('')['response']->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testInvalidapiResourceCreate() : void
|
||||||
|
{
|
||||||
|
$response = new HttpResponse();
|
||||||
|
$request = new HttpRequest(new HttpUri(''));
|
||||||
|
|
||||||
|
$request->header->account = 1;
|
||||||
|
$this->module->apiResourceCreate($request, $response);
|
||||||
|
self::assertEquals(RequestStatusCode::R_400, $response->header->status);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testInvalidapiInformDelete() : void
|
||||||
|
{
|
||||||
|
$response = new HttpResponse();
|
||||||
|
$request = new HttpRequest(new HttpUri(''));
|
||||||
|
|
||||||
|
$request->header->account = 1;
|
||||||
|
$this->module->apiInformDelete($request, $response);
|
||||||
|
self::assertEquals(RequestStatusCode::R_400, $response->header->status);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user