Strickt array check in mock service
This commit is contained in:
parent
5077da82bb
commit
df95575532
|
@ -4,6 +4,7 @@ global $utopia, $request, $response;
|
|||
|
||||
use Utopia\Validator\Numeric;
|
||||
use Utopia\Validator\Text;
|
||||
use Utopia\Validator\ArrayList;
|
||||
|
||||
$result = [];
|
||||
|
||||
|
@ -15,7 +16,7 @@ $utopia->get('/v1/mock/tests/foo')
|
|||
->label('sdk.description', 'Mock a get request for SDK tests')
|
||||
->param('x', '', function () { return new Text(100); }, 'Sample string param')
|
||||
->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
|
||||
->param('z', [], function () { return new ArrayList(new Text(256)); }, 'Sample array param')
|
||||
->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
|
||||
->action(
|
||||
function ($x, $y, $z) {
|
||||
|
||||
|
@ -30,7 +31,7 @@ $utopia->post('/v1/mock/tests/foo')
|
|||
->label('sdk.description', 'Mock a post request for SDK tests')
|
||||
->param('x', '', function () { return new Text(100); }, 'Sample string param')
|
||||
->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
|
||||
->param('z', [], function () { return new ArrayList(new Text(256)); }, 'Sample array param')
|
||||
->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
|
||||
->action(
|
||||
function ($x, $y, $z) {
|
||||
|
||||
|
@ -45,7 +46,7 @@ $utopia->patch('/v1/mock/tests/foo')
|
|||
->label('sdk.description', 'Mock a get request for SDK tests')
|
||||
->param('x', '', function () { return new Text(100); }, 'Sample string param')
|
||||
->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
|
||||
->param('z', [], function () { return new ArrayList(new Text(256)); }, 'Sample array param')
|
||||
->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
|
||||
->action(
|
||||
function ($x, $y, $z) {
|
||||
|
||||
|
@ -60,7 +61,7 @@ $utopia->put('/v1/mock/tests/foo')
|
|||
->label('sdk.description', 'Mock a put request for SDK tests')
|
||||
->param('x', '', function () { return new Text(100); }, 'Sample string param')
|
||||
->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
|
||||
->param('z', [], function () { return new ArrayList(new Text(256)); }, 'Sample array param')
|
||||
->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
|
||||
->action(
|
||||
function ($x, $y, $z) {
|
||||
|
||||
|
@ -75,7 +76,7 @@ $utopia->delete('/v1/mock/tests/foo')
|
|||
->label('sdk.description', 'Mock a delete request for SDK tests')
|
||||
->param('x', '', function () { return new Text(100); }, 'Sample string param')
|
||||
->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
|
||||
->param('z', [], function () { return new ArrayList(new Text(256)); }, 'Sample array param')
|
||||
->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
|
||||
->action(
|
||||
function ($x, $y, $z) {
|
||||
|
||||
|
@ -90,7 +91,7 @@ $utopia->get('/v1/mock/tests/bar')
|
|||
->label('sdk.description', 'Mock a get request for SDK tests')
|
||||
->param('x', '', function () { return new Text(100); }, 'Sample string param')
|
||||
->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
|
||||
->param('z', [], function () { return new ArrayList(new Text(256)); }, 'Sample array param')
|
||||
->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
|
||||
->action(
|
||||
function ($x, $y, $z) {
|
||||
|
||||
|
@ -105,7 +106,7 @@ $utopia->post('/v1/mock/tests/bar')
|
|||
->label('sdk.description', 'Mock a post request for SDK tests')
|
||||
->param('x', '', function () { return new Text(100); }, 'Sample string param')
|
||||
->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
|
||||
->param('z', [], function () { return new ArrayList(new Text(256)); }, 'Sample array param')
|
||||
->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
|
||||
->action(
|
||||
function ($x, $y, $z) {
|
||||
|
||||
|
@ -120,7 +121,7 @@ $utopia->patch('/v1/mock/tests/bar')
|
|||
->label('sdk.description', 'Mock a get request for SDK tests')
|
||||
->param('x', '', function () { return new Text(100); }, 'Sample string param')
|
||||
->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
|
||||
->param('z', [], function () { return new ArrayList(new Text(256)); }, 'Sample array param')
|
||||
->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
|
||||
->action(
|
||||
function ($x, $y, $z) {
|
||||
|
||||
|
@ -135,7 +136,7 @@ $utopia->put('/v1/mock/tests/bar')
|
|||
->label('sdk.description', 'Mock a put request for SDK tests')
|
||||
->param('x', '', function () { return new Text(100); }, 'Sample string param')
|
||||
->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
|
||||
->param('z', [], function () { return new ArrayList(new Text(256)); }, 'Sample array param')
|
||||
->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
|
||||
->action(
|
||||
function ($x, $y, $z) {
|
||||
|
||||
|
@ -150,7 +151,7 @@ $utopia->delete('/v1/mock/tests/bar')
|
|||
->label('sdk.description', 'Mock a delete request for SDK tests')
|
||||
->param('x', '', function () { return new Text(100); }, 'Sample string param')
|
||||
->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
|
||||
->param('z', [], function () { return new ArrayList(new Text(256)); }, 'Sample array param')
|
||||
->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
|
||||
->action(
|
||||
function ($x, $y, $z) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue