Replace DI::app() with DI::appHelper() in more tests

This commit is contained in:
Art4 2024-12-18 21:06:55 +00:00
parent b2a383a9cb
commit ba65cad1cd
31 changed files with 56 additions and 56 deletions

View file

@ -18,7 +18,7 @@ class ConfigTest extends ApiTestCase
*/ */
public function testApiStatusnetConfig() public function testApiStatusnetConfig()
{ {
$response = (new Config(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Config(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
$json = $this->toJson($response); $json = $this->toJson($response);

View file

@ -16,7 +16,7 @@ class VersionTest extends ApiTestCase
{ {
public function test() public function test()
{ {
$response = (new Version(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new Version(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
self::assertEquals([ self::assertEquals([

View file

@ -16,7 +16,7 @@ class TestTest extends ApiTestCase
{ {
public function testJson() public function testJson()
{ {
$response = (new Test(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new Test(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
$json = $this->toJson($response); $json = $this->toJson($response);
@ -30,7 +30,7 @@ class TestTest extends ApiTestCase
public function testXml() public function testXml()
{ {
$response = (new Test(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml'])) $response = (new Test(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml']))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
self::assertEquals([ self::assertEquals([

View file

@ -20,7 +20,7 @@ class VerifyCredentialsTest extends ApiTestCase
*/ */
public function testApiAccountVerifyCredentials() public function testApiAccountVerifyCredentials()
{ {
$response = (new VerifyCredentials(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new VerifyCredentials(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
$json = $this->toJson($response); $json = $this->toJson($response);

View file

@ -22,7 +22,7 @@ class PushSubscriptionTest extends ApiTestCase
// $this->useHttpMethod(Router::POST); // $this->useHttpMethod(Router::POST);
// //
// $response = (new PushSubscription(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), DI::mstdnSubscription(), DI::mstdnError(), [])) // $response = (new PushSubscription(DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), DI::mstdnSubscription(), DI::mstdnError(), []))
// ->run(); // ->run();
// //
// $json = $this->toJson($response); // $json = $this->toJson($response);

View file

@ -16,7 +16,7 @@ class RateLimitStatusTest extends ApiTestCase
{ {
public function testWithJson() public function testWithJson()
{ {
$response = (new RateLimitStatus(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new RateLimitStatus(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
$result = $this->toJson($response); $result = $this->toJson($response);
@ -32,7 +32,7 @@ class RateLimitStatusTest extends ApiTestCase
public function testWithXml() public function testWithXml()
{ {
$response = (new RateLimitStatus(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml'])) $response = (new RateLimitStatus(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml']))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
self::assertEquals([ self::assertEquals([

View file

@ -21,7 +21,7 @@ class UpdateProfileTest extends ApiTestCase
{ {
$this->useHttpMethod(Router::POST); $this->useHttpMethod(Router::POST);
$response = (new UpdateProfile(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new UpdateProfile(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'name' => 'new_name', 'name' => 'new_name',
'description' => 'new_description' 'description' => 'new_description'

View file

@ -18,7 +18,7 @@ class ListsTest extends ApiTestCase
*/ */
public function testApiStatusesFWithBlocks() public function testApiStatusesFWithBlocks()
{ {
$response = (new Lists(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Lists(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
$json = $this->toJson($response); $json = $this->toJson($response);

View file

@ -25,7 +25,7 @@ class AllTest extends ApiTestCase
$directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser());
$response = (new All($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new All($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
$json = $this->toJson($response); $json = $this->toJson($response);

View file

@ -23,7 +23,7 @@ class ConversationTest extends ApiTestCase
{ {
$directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser());
$response = (new Conversation($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new Conversation($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'friendica_verbose' => true, 'friendica_verbose' => true,
]); ]);

View file

@ -31,7 +31,7 @@ class DestroyTest extends ApiTestCase
{ {
$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::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }
@ -42,7 +42,7 @@ class DestroyTest extends ApiTestCase
*/ */
public function testApiDirectMessagesDestroyWithVerbose() public function testApiDirectMessagesDestroyWithVerbose()
{ {
$response = (new Destroy(DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new Destroy(DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'friendica_verbose' => true, 'friendica_verbose' => true,
]); ]);
@ -78,7 +78,7 @@ class DestroyTest extends ApiTestCase
public function testApiDirectMessagesDestroyWithId() public function testApiDirectMessagesDestroyWithId()
{ {
$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::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'id' => 1 'id' => 1
]); ]);
@ -91,7 +91,7 @@ class DestroyTest extends ApiTestCase
*/ */
public function testApiDirectMessagesDestroyWithIdAndVerbose() public function testApiDirectMessagesDestroyWithIdAndVerbose()
{ {
$response = (new Destroy(DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new Destroy(DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'id' => 1, 'id' => 1,
'friendica_parenturi' => 'parent_uri', 'friendica_parenturi' => 'parent_uri',
@ -115,7 +115,7 @@ class DestroyTest extends ApiTestCase
$ids = DBA::selectToArray('mail', ['id']); $ids = DBA::selectToArray('mail', ['id']);
$id = $ids[0]['id']; $id = $ids[0]['id'];
$response = (new Destroy(DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new Destroy(DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'id' => $id, 'id' => $id,
'friendica_verbose' => true, 'friendica_verbose' => true,

View file

@ -25,7 +25,7 @@ class InboxTest extends ApiTestCase
$directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser());
$response = (new Inbox($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new Inbox($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
$json = $this->toJson($response); $json = $this->toJson($response);

View file

@ -31,7 +31,7 @@ class NewDMTest extends ApiTestCase
{ {
$directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser());
$response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
self::assertEmpty((string)$response->getBody()); self::assertEmpty((string)$response->getBody());
@ -63,7 +63,7 @@ class NewDMTest extends ApiTestCase
{ {
$directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser());
$response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'text' => 'message_text', 'text' => 'message_text',
'user_id' => 43 'user_id' => 43
@ -85,7 +85,7 @@ class NewDMTest extends ApiTestCase
$directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser());
$response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'text' => 'message_text', 'text' => 'message_text',
'user_id' => 44 'user_id' => 44
@ -109,7 +109,7 @@ class NewDMTest extends ApiTestCase
$directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser());
$response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'text' => 'message_text', 'text' => 'message_text',
'user_id' => 44, 'user_id' => 44,
@ -135,7 +135,7 @@ class NewDMTest extends ApiTestCase
$directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser());
$response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'rss'])) $response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'rss']))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'text' => 'message_text', 'text' => 'message_text',
'user_id' => 44, 'user_id' => 44,

View file

@ -23,7 +23,7 @@ class SentTest extends ApiTestCase
{ {
$directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser());
$response = (new Sent($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new Sent($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'friendica_verbose' => true, 'friendica_verbose' => true,
]); ]);
@ -43,7 +43,7 @@ class SentTest extends ApiTestCase
{ {
$directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser());
$response = (new Sent($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'rss'])) $response = (new Sent($directMessage, DI::dba(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'rss']))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
self::assertXml((string)$response->getBody(), 'direct-messages'); self::assertXml((string)$response->getBody(), 'direct-messages');

View file

@ -32,7 +32,7 @@ class CreateTest extends ApiTestCase
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Create(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Create(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }
@ -43,7 +43,7 @@ class CreateTest extends ApiTestCase
*/ */
public function testApiFavoritesCreateDestroyWithCreateAction() public function testApiFavoritesCreateDestroyWithCreateAction()
{ {
$response = (new Create(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Create(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'id' => 3 'id' => 3
]); ]);
@ -60,7 +60,7 @@ class CreateTest extends ApiTestCase
*/ */
public function testApiFavoritesCreateDestroyWithCreateActionAndRss() public function testApiFavoritesCreateDestroyWithCreateActionAndRss()
{ {
$response = (new Create(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => ICanCreateResponses::TYPE_RSS])) $response = (new Create(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => ICanCreateResponses::TYPE_RSS]))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'id' => 3 'id' => 3
]); ]);

View file

@ -31,7 +31,7 @@ class DestroyTest extends ApiTestCase
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Destroy(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Destroy(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }
@ -42,7 +42,7 @@ class DestroyTest extends ApiTestCase
*/ */
public function testApiFavoritesCreateDestroyWithDestroyAction() public function testApiFavoritesCreateDestroyWithDestroyAction()
{ {
$response = (new Destroy(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Destroy(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'id' => 3 'id' => 3
]); ]);

View file

@ -18,7 +18,7 @@ class ListsTest extends ApiTestCase
*/ */
public function testApiStatusesFWithFollowers() public function testApiStatusesFWithFollowers()
{ {
$response = (new Lists(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Lists(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
$json = $this->toJson($response); $json = $this->toJson($response);

View file

@ -20,7 +20,7 @@ class ListsTest extends ApiTestCase
*/ */
public function testApiStatusesFWithFriends() public function testApiStatusesFWithFriends()
{ {
$response = (new Lists(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Lists(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
$json = $this->toJson($response); $json = $this->toJson($response);

View file

@ -20,7 +20,7 @@ class IncomingTest extends ApiTestCase
*/ */
public function testApiFriendshipsIncoming() public function testApiFriendshipsIncoming()
{ {
$response = (new Incoming(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Incoming(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
$json = $this->toJson($response); $json = $this->toJson($response);

View file

@ -23,7 +23,7 @@ class StatusesTest extends ApiTestCase
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Statuses(DI::dba(), DI::twitterStatus(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Statuses(DI::dba(), DI::twitterStatus(), DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }

View file

@ -32,7 +32,7 @@ class UploadTest extends ApiTestCase
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Upload(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Upload(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }
@ -46,7 +46,7 @@ class UploadTest extends ApiTestCase
$this->expectException(UnauthorizedException::class); $this->expectException(UnauthorizedException::class);
AuthTestConfig::$authenticated = false; AuthTestConfig::$authenticated = false;
(new Upload(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Upload(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }
@ -65,7 +65,7 @@ class UploadTest extends ApiTestCase
] ]
]; ];
(new Upload(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Upload(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }
@ -88,7 +88,7 @@ class UploadTest extends ApiTestCase
] ]
]; ];
$response = (new Upload(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Upload(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
$media = $this->toJson($response); $media = $this->toJson($response);

View file

@ -16,7 +16,7 @@ class SavedSearchesTest extends ApiTestCase
{ {
public function test() public function test()
{ {
$response = (new SavedSearches(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new SavedSearches(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
$result = $this->toJson($response); $result = $this->toJson($response);

View file

@ -31,7 +31,7 @@ class DestroyTest extends ApiTestCase
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Destroy(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Destroy(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }
@ -57,7 +57,7 @@ class DestroyTest extends ApiTestCase
*/ */
public function testApiStatusesDestroyWithId() public function testApiStatusesDestroyWithId()
{ {
$response = (new Destroy(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Destroy(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'id' => 1 'id' => 1
]); ]);

View file

@ -21,7 +21,7 @@ class MentionsTest extends ApiTestCase
*/ */
public function testApiStatusesMentions() public function testApiStatusesMentions()
{ {
$response = (new Mentions(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Mentions(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'max_id' => 10 'max_id' => 10
]); ]);
@ -39,7 +39,7 @@ class MentionsTest extends ApiTestCase
*/ */
public function testApiStatusesMentionsWithNegativePage() public function testApiStatusesMentionsWithNegativePage()
{ {
$response = (new Mentions(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Mentions(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'page' => -2 'page' => -2
]); ]);
@ -71,7 +71,7 @@ class MentionsTest extends ApiTestCase
*/ */
public function testApiStatusesMentionsWithRss() public function testApiStatusesMentionsWithRss()
{ {
$response = (new Mentions(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => ICanCreateResponses::TYPE_RSS])) $response = (new Mentions(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => ICanCreateResponses::TYPE_RSS]))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'page' => -2 'page' => -2
]); ]);

View file

@ -31,7 +31,7 @@ class RetweetTest extends ApiTestCase
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Retweet(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Retweet(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }
@ -57,7 +57,7 @@ class RetweetTest extends ApiTestCase
*/ */
public function testApiStatusesRepeatWithId() public function testApiStatusesRepeatWithId()
{ {
$response = (new Retweet(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Retweet(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'id' => 1 'id' => 1
]); ]);

View file

@ -24,7 +24,7 @@ class ShowTest extends ApiTestCase
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Show(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Show(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }
@ -35,7 +35,7 @@ class ShowTest extends ApiTestCase
*/ */
public function testApiStatusesShowWithId() public function testApiStatusesShowWithId()
{ {
$response = (new Show(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Show(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'id' => 1 'id' => 1
]); ]);

View file

@ -40,7 +40,7 @@ class UpdateTest extends ApiTestCase
] ]
]; ];
$response = (new Update(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Update(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'status' => 'Status content #friendica', 'status' => 'Status content #friendica',
'in_reply_to_status_id' => 0, 'in_reply_to_status_id' => 0,
@ -62,7 +62,7 @@ class UpdateTest extends ApiTestCase
*/ */
public function testApiStatusesUpdateWithHtml() public function testApiStatusesUpdateWithHtml()
{ {
$response = (new Update(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Update(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'htmlstatus' => '<b>Status content</b>', 'htmlstatus' => '<b>Status content</b>',
]); ]);

View file

@ -21,7 +21,7 @@ class UserTimelineTest extends ApiTestCase
*/ */
public function testApiStatusesUserTimeline() public function testApiStatusesUserTimeline()
{ {
$response = (new UserTimeline(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new UserTimeline(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'user_id' => 43, // Public contact id 'user_id' => 43, // Public contact id
'max_id' => 10, 'max_id' => 10,
@ -69,7 +69,7 @@ class UserTimelineTest extends ApiTestCase
*/ */
public function testApiStatusesUserTimelineWithRss() public function testApiStatusesUserTimelineWithRss()
{ {
$response = (new UserTimeline(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [ $response = (new UserTimeline(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [
'extension' => ICanCreateResponses::TYPE_RSS 'extension' => ICanCreateResponses::TYPE_RSS
]))->run($this->httpExceptionMock); ]))->run($this->httpExceptionMock);

View file

@ -23,7 +23,7 @@ class LookupTest extends ApiTestCase
{ {
$this->expectException(NotFoundException::class); $this->expectException(NotFoundException::class);
(new Lookup(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Lookup(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }

View file

@ -57,7 +57,7 @@ class SearchTest extends ApiTestCase
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Search(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Search(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }
} }

View file

@ -21,7 +21,7 @@ class ShowTest extends ApiTestCase
*/ */
public function testApiUsersShow() public function testApiUsersShow()
{ {
$response = (new Show(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Show(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
$json = $this->toJson($response); $json = $this->toJson($response);
@ -41,7 +41,7 @@ class ShowTest extends ApiTestCase
*/ */
public function testApiUsersShowWithXml() public function testApiUsersShowWithXml()
{ {
$response = (new Show(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [ $response = (new Show(DI::mstdnError(), DI::appHelper(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [
'extension' => ICanCreateResponses::TYPE_XML 'extension' => ICanCreateResponses::TYPE_XML
]))->run($this->httpExceptionMock); ]))->run($this->httpExceptionMock);