Adapt tests using a content file

This commit is contained in:
Philipp Holzer 2021-05-23 20:30:27 +02:00
parent a0da84b6b0
commit c064a39341
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD
3 changed files with 8 additions and 5 deletions

View file

@ -271,7 +271,7 @@ class HTTPInputData
}
/**
* Returns the content of tje current PHP input
* Returns the content of the current PHP input
* Mainly used for test doubling
* @return false|string
*/

View file

@ -0,0 +1,3 @@
anything you want
As you
like it

View file

@ -41,11 +41,11 @@ class HTTPInputDataTest extends MockedTest
{
return [
'example' => [
'input' => 'anything you want',
'input' => file_get_contents(__DIR__ . '/../../datasets/http/example1.httpinput'),
'expected' => [
'variables' => [
'var1' => 'value',
'var2' => 'value',
'var1' => 'value1',
'var2' => 'value2',
],
'files' => []
]
@ -69,6 +69,6 @@ class HTTPInputDataTest extends MockedTest
HTTPInputDataDouble::setPhpInputStream($stream);
$output = HTTPInputDataDouble::process();
$this->assertEqualsCanonicalizing($output, $expected);
$this->assertEqualsCanonicalizing($expected, $output);
}
}