Fix tests

This commit is contained in:
Michael 2024-07-31 04:01:27 +00:00
parent 2c9f312e33
commit 1f18e096fe
3 changed files with 16 additions and 0 deletions

View file

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

View file

@ -29,6 +29,13 @@ use Friendica\Test\src\Module\Api\ApiTest;
class DestroyTest extends ApiTest class DestroyTest extends ApiTest
{ {
protected function setUp(): void
{
parent::setUp();
$this->useHttpMethod(Router::POST);
}
/** /**
* Test the api_direct_messages_destroy() function. * Test the api_direct_messages_destroy() function.
* *
@ -37,6 +44,7 @@ class DestroyTest extends ApiTest
public function testApiDirectMessagesDestroy() public function testApiDirectMessagesDestroy()
{ {
$this->expectException(\Friendica\Network\HTTPException\BadRequestException::class); $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'])) (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); ->run($this->httpExceptionMock);
} }

View file

@ -29,6 +29,13 @@ use Friendica\Test\src\Module\Api\ApiTest;
class NewDMTest extends ApiTest class NewDMTest extends ApiTest
{ {
protected function setUp(): void
{
parent::setUp();
$this->useHttpMethod(Router::POST);
}
/** /**
* Test the api_direct_messages_new() function. * Test the api_direct_messages_new() function.
* *