]> git.mxchange.org Git - friendica.git/commitdiff
Fixing tests?
authorMichael <heluecht@pirati.ca>
Tue, 30 Nov 2021 05:38:59 +0000 (05:38 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 30 Nov 2021 05:38:59 +0000 (05:38 +0000)
tests/legacy/ApiTest.php

index f4a6d3905e0ae3091e96bef00be71f9d145b74d8..f45b5720c80a5b8aaa38b0e0bee77981d4953d66 100644 (file)
@@ -6,6 +6,7 @@
 namespace Friendica\Test\legacy;
 
 use Friendica\App;
+use Friendica\App\Router;
 use Friendica\Core\Config\Capability\IManageConfigValues;
 use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
 use Friendica\Core\Protocol;
@@ -1006,7 +1007,7 @@ class ApiTest extends FixtureTest
        public function testApiMediaUpload()
        {
                $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
-               (new Upload(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), $_SERVER))->run();
+               (new Upload(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::POST]))->run();
        }
 
        /**
@@ -1019,7 +1020,7 @@ class ApiTest extends FixtureTest
                $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
                BasicAuth::setCurrentUserID();
                $_SESSION['authenticated'] = false;
-               (new Upload(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), $_SERVER))->run();
+               (new Upload(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::POST]))->run();
        }
 
        /**
@@ -1036,7 +1037,7 @@ class ApiTest extends FixtureTest
                                'tmp_name' => 'tmp_name'
                        ]
                ];
-               (new Upload(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), $_SERVER))->run();
+               (new Upload(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::POST]))->run();
        }
 
        /**
@@ -1058,7 +1059,7 @@ class ApiTest extends FixtureTest
                        ]
                ];
 
-               $response = (new Upload(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), $_SERVER))->run();
+               $response = (new Upload(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::POST]))->run();
                $media = json_decode($response->getBody(), true);
 
                self::assertEquals('image/png', $media['image']['image_type']);