Set the content type at another location
This commit is contained in:
parent
d758f58ff2
commit
4889687659
1 changed files with 10 additions and 6 deletions
|
@ -39,10 +39,11 @@ class HTTPInputDataTest extends MockedTest
|
||||||
*/
|
*/
|
||||||
public function dataStream()
|
public function dataStream()
|
||||||
{
|
{
|
||||||
$_SERVER['CONTENT_TYPE'] = 'multipart/form-data;boundary=43395968-f65c-437e-b536-5b33e3e3c7e5;charset=utf8';
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'example' => [
|
'example' => [
|
||||||
|
'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/example1.httpinput'),
|
||||||
'expected' => [
|
'expected' => [
|
||||||
'variables' => [
|
'variables' => [
|
||||||
|
@ -69,12 +70,15 @@ class HTTPInputDataTest extends MockedTest
|
||||||
/**
|
/**
|
||||||
* Tests the HTTPInputData::process() method
|
* Tests the HTTPInputData::process() method
|
||||||
* @see HTTPInputData::process()
|
* @see HTTPInputData::process()
|
||||||
|
* @param string $contenttype The content typer of the transmitted data
|
||||||
* @param string $input The input, we got from the data stream
|
* @param string $input The input, we got from the data stream
|
||||||
* @param array $expected The expected output
|
* @param array $expected The expected output
|
||||||
* @dataProvider dataStream
|
* @dataProvider dataStream
|
||||||
*/
|
*/
|
||||||
public function testHttpInput(string $input, array $expected)
|
public function testHttpInput(string $contenttype, string $input, array $expected)
|
||||||
{
|
{
|
||||||
|
$_SERVER['CONTENT_TYPE'] = $contenttype;
|
||||||
|
|
||||||
HTTPInputDataDouble::setPhpInputContent($input);
|
HTTPInputDataDouble::setPhpInputContent($input);
|
||||||
$stream = fopen('php://memory', 'r+');
|
$stream = fopen('php://memory', 'r+');
|
||||||
fwrite($stream, $input);
|
fwrite($stream, $input);
|
||||||
|
|
Loading…
Reference in a new issue