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() public function dataStream()
{ {
return [ return [
'example' => [ 'multipart' => [
'contenttype' => 'multipart/form-data;boundary=43395968-f65c-437e-b536-5b33e3e3c7e5;charset=utf8', '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' => [ 'expected' => [
'variables' => [ 'variables' => [
'display_name' => 'User Name', 'display_name' => 'User Name',
@ -61,6 +61,30 @@ class HTTPInputDataTest extends MockedTest
], ],
'files' => [] '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' => []
]
] ]
]; ];
} }