mirror of
https://github.com/friendica/friendica
synced 2025-04-23 01:50:10 +00:00
Introduce FixtureTest::useHttpMethod for manually overwrite the HTTP Method argument
This commit is contained in:
parent
4e67bfed8d
commit
5e85939502
36 changed files with 175 additions and 82 deletions
|
@ -10,6 +10,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_favorites_create_destroy() function with an invalid ID.
|
||||
*
|
||||
|
@ -19,7 +26,7 @@ class DestroyTest extends ApiTest
|
|||
{
|
||||
$this->expectException(BadRequestException::class);
|
||||
|
||||
(new Destroy(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::POST]))
|
||||
(new Destroy(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
|
||||
->run();
|
||||
}
|
||||
|
||||
|
@ -30,7 +37,7 @@ class DestroyTest extends ApiTest
|
|||
*/
|
||||
public function testApiFavoritesCreateDestroyWithDestroyAction()
|
||||
{
|
||||
$response = (new Destroy(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::POST]))
|
||||
$response = (new Destroy(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
|
||||
->run([
|
||||
'id' => 3
|
||||
]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue