]> git.mxchange.org Git - friendica.git/blobdiff - tests/src/Util/HTTPInputDataTest.php
Merge pull request #13375 from MrPetovan/bug/empty-timeline
[friendica.git] / tests / src / Util / HTTPInputDataTest.php
index c3d4f384649ae41805ddd89c1545b422c40ac741..9a302d64b5820eac734ede2c6bd43500e222c39c 100644 (file)
@@ -1,6 +1,6 @@
 <?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
  *
@@ -86,14 +86,14 @@ class HTTPInputDataTest extends MockedTest
                                                'avatar' => [
                                                        'name'     => '8ZUCS34Y5XNH',
                                                        'type'     => 'image/png',
-                                                       'tmp_name' => '/tmp/phpf85nKJ',
+                                                       'tmp_name' => '8ZUCS34Y5XNH',
                                                        'error'    => 0,
                                                        'size'     => 349330
                                                ],
                                                'header' => [
                                                        'name'     => 'V2B6Z1IICGPM',
                                                        'type'     => 'image/png',
-                                                       'tmp_name' => '/tmp/phpe3sqHT',
+                                                       'tmp_name' => 'V2B6Z1IICGPM',
                                                        'error'    => 0,
                                                        'size'     => 1323635
                                                ]
@@ -139,14 +139,15 @@ class HTTPInputDataTest extends MockedTest
         */
        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);
        }
 }