Two (hopefully) easy tests added

This commit is contained in:
Michael 2021-05-24 04:33:42 +00:00
parent a69e128fe4
commit 49c2431f1f
4 changed files with 28 additions and 2 deletions

View file

@ -0,0 +1 @@
{"media_ids":[],"sensitive":false,"status":"Test Status","visibility":"private","spoiler_text":"Title"}

View file

@ -0,0 +1 @@
title=Test2

View file

@ -40,9 +40,9 @@ class HTTPInputDataTest extends MockedTest
public function dataStream()
{
return [
'example' => [
'multipart' => [
'contenttype' => 'multipart/form-data;boundary=43395968-f65c-437e-b536-5b33e3e3c7e5;charset=utf8',
'input' => file_get_contents(__DIR__ . '/../../datasets/http/example1.httpinput'),
'input' => file_get_contents(__DIR__ . '/../../datasets/http/multipart.httpinput'),
'expected' => [
'variables' => [
'display_name' => 'User Name',
@ -61,6 +61,30 @@ class HTTPInputDataTest extends MockedTest
],
'files' => []
]
],
'form-urlencoded' => [
'contenttype' => 'application/x-www-form-urlencoded;charset=utf8',
'input' => file_get_contents(__DIR__ . '/../../datasets/http/form-urlencoded.httpinput'),
'expected' => [
'variables' => [
'title' => 'Test2',
],
'files' => []
]
],
'form-urlencoded-json' => [
'contenttype' => 'application/x-www-form-urlencoded;charset=utf8',
'input' => file_get_contents(__DIR__ . '/../../datasets/http/form-urlencoded-json.httpinput'),
'expected' => [
'variables' => [
'media_ids' => [],
'sensitive' => false,
'status' => 'Test Status',
'visibility' => 'private',
'spoiler_text' => 'Title'
],
'files' => []
]
]
];
}