mirror of
https://github.com/friendica/friendica
synced 2024-11-10 00:23:00 +00:00
Adapt tests using a content file
This commit is contained in:
parent
a0da84b6b0
commit
c064a39341
3 changed files with 8 additions and 5 deletions
|
@ -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
|
||||
*/
|
||||
|
|
3
tests/datasets/http/example1.httpinput
Normal file
3
tests/datasets/http/example1.httpinput
Normal file
|
@ -0,0 +1,3 @@
|
|||
anything you want
|
||||
As you
|
||||
like it
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue