<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
*/
public function testHttpInput(string $contentType, string $input, array $expected)
{
- HTTPInputDataDouble::setPhpInputContentType($contentType);
- HTTPInputDataDouble::setPhpInputContent($input);
+ $httpInput = new HTTPInputDataDouble(['CONTENT_TYPE' => $contentType]);
+ $httpInput->setPhpInputContent($input);
+
$stream = fopen('php://memory', 'r+');
fwrite($stream, $input);
rewind($stream);
- HTTPInputDataDouble::setPhpInputStream($stream);
- $output = HTTPInputDataDouble::process();
+ $httpInput->setPhpInputStream($stream);
+ $output = $httpInput->process();
$this->assertEqualsCanonicalizing($expected, $output);
}
}