Merge pull request #14334 from annando/tests

Fix tests
This commit is contained in:
Tobias Diekershoff 2024-07-31 06:44:23 +02:00 committed by GitHub
commit e31f94e93e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 0 deletions

View file

@ -47,6 +47,7 @@ class Destroy extends BaseApi
$this->dba = $dba;
}
protected function post(array $request = [])
{
$this->checkAllowedScope(BaseApi::SCOPE_WRITE);

View 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);
}

View 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.
*