]> git.mxchange.org Git - friendica.git/commitdiff
Fix tests
authorMichael <heluecht@pirati.ca>
Wed, 31 Jul 2024 04:01:27 +0000 (04:01 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 31 Jul 2024 04:38:03 +0000 (04:38 +0000)
src/Module/Api/Twitter/DirectMessages/Destroy.php
tests/src/Module/Api/Twitter/DirectMessages/DestroyTest.php
tests/src/Module/Api/Twitter/DirectMessages/NewDMTest.php

index 0cd9252049442e67b5f0e03026db1ebb62c73605..b83a719dcfad1d7f5dba881847ee87c583da9781 100644 (file)
@@ -47,6 +47,7 @@ class Destroy extends BaseApi
 
                $this->dba = $dba;
        }
+
        protected function post(array $request = [])
        {
                $this->checkAllowedScope(BaseApi::SCOPE_WRITE);
index ba7964b0a194a8c86ae875cad7c0cdffb4cf05c1..91f72b4e57307f4b764931cfb2ea3617f668c88e 100644 (file)
@@ -29,6 +29,13 @@ use Friendica\Test\src\Module\Api\ApiTest;
 
 class DestroyTest extends ApiTest
 {
+       protected function setUp(): void
+       {
+               parent::setUp();
+
+               $this->useHttpMethod(Router::POST);
+       }
+
        /**
         * Test the api_direct_messages_destroy() function.
         *
@@ -37,6 +44,7 @@ class DestroyTest extends ApiTest
        public function testApiDirectMessagesDestroy()
        {
                $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
+
                (new Destroy(DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
                        ->run($this->httpExceptionMock);
        }
index ebd7ef8df642130138f12114c8f2972fe0bea857..ff00b652044632bacf77499e9a735e3c4c2ec575 100644 (file)
@@ -29,6 +29,13 @@ use Friendica\Test\src\Module\Api\ApiTest;
 
 class NewDMTest extends ApiTest
 {
+       protected function setUp(): void
+       {
+               parent::setUp();
+
+               $this->useHttpMethod(Router::POST);
+       }
+
        /**
         * Test the api_direct_messages_new() function.
         *