Updated mock server
This commit is contained in:
parent
7532a96bb3
commit
b216917f1c
|
@ -222,6 +222,32 @@ $utopia->get('/v1/mock/tests/general/redirected')
|
|||
}
|
||||
);
|
||||
|
||||
$utopia->get('/v1/mock/tests/general/set-cookie')
|
||||
->desc('Mock a cookie request for SDK tests')
|
||||
->label('scope', 'public')
|
||||
->label('sdk.namespace', 'general')
|
||||
->label('sdk.method', 'setCookie')
|
||||
->label('sdk.description', 'Mock a set cookie request for SDK tests')
|
||||
->action(
|
||||
function () use ($response) {
|
||||
$response->addCookie('cookieName', 'cookieValue', time() + 31536000, '/', 'localhost', true, true);
|
||||
}
|
||||
);
|
||||
|
||||
$utopia->get('/v1/mock/tests/general/get-cookie')
|
||||
->desc('Mock a cookie request for SDK tests')
|
||||
->label('scope', 'public')
|
||||
->label('sdk.namespace', 'general')
|
||||
->label('sdk.method', 'setCookie')
|
||||
->label('sdk.description', 'Mock a set cookie request for SDK tests')
|
||||
->action(
|
||||
function () use ($request) {
|
||||
if($request->getCookie('cookieName', '') !== 'cookieValue') {
|
||||
throw new Exception('Missing cookie value', 400);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$utopia->get('/v1/mock/tests/general/empty')
|
||||
->desc('Mock a post request for SDK tests')
|
||||
->label('scope', 'public')
|
||||
|
|
12
composer.lock
generated
12
composer.lock
generated
|
@ -1622,7 +1622,7 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/appwrite/sdk-generator",
|
||||
"reference": "97cb12c9c187a42a545060c324b0960c99582893"
|
||||
"reference": "6b98e2620bf307f35070e883819e157fb24e2014"
|
||||
},
|
||||
"require": {
|
||||
"ext-curl": "*",
|
||||
|
@ -1652,7 +1652,7 @@
|
|||
}
|
||||
],
|
||||
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
|
||||
"time": "2020-03-27T15:12:28+00:00"
|
||||
"time": "2020-04-04T14:33:15+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/instantiator",
|
||||
|
@ -3252,12 +3252,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/twigphp/Twig.git",
|
||||
"reference": "6df2e2c3181e6d0b961fc341fbe8269fefc933c6"
|
||||
"reference": "e3ff236877694af42d51506dd7476a224fb829fb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/6df2e2c3181e6d0b961fc341fbe8269fefc933c6",
|
||||
"reference": "6df2e2c3181e6d0b961fc341fbe8269fefc933c6",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/e3ff236877694af42d51506dd7476a224fb829fb",
|
||||
"reference": "e3ff236877694af42d51506dd7476a224fb829fb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -3309,7 +3309,7 @@
|
|||
"keywords": [
|
||||
"templating"
|
||||
],
|
||||
"time": "2020-03-27T16:41:01+00:00"
|
||||
"time": "2020-03-31T06:42:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "webmozart/assert",
|
||||
|
|
Loading…
Reference in a new issue