Add newly required constructor parameter to BaseApi-related tests

This commit is contained in:
Hypolite Petovan 2023-10-11 10:01:32 -04:00
parent 1b9ec3a214
commit 5d428ac8af
37 changed files with 85 additions and 85 deletions

View File

@ -34,7 +34,7 @@ class SearchTest extends ApiTest
{ {
$directMessage = new DirectMessage(new NullLogger(), DI::dba(), DI::twitterUser()); $directMessage = new DirectMessage(new NullLogger(), DI::dba(), DI::twitterUser());
$response = (new Search($directMessage, DI::dba(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Search($directMessage, DI::dba(), DI::mstdnError(), DI::app(), 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);
@ -52,7 +52,7 @@ class SearchTest extends ApiTest
$directMessage = new DirectMessage(new NullLogger(), DI::dba(), DI::twitterUser()); $directMessage = new DirectMessage(new NullLogger(), DI::dba(), DI::twitterUser());
$response = (new Search($directMessage, DI::dba(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Search($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'searchstring' => 'item_body' 'searchstring' => 'item_body'
]); ]);
@ -73,7 +73,7 @@ class SearchTest extends ApiTest
{ {
$directMessage = new DirectMessage(new NullLogger(), DI::dba(), DI::twitterUser()); $directMessage = new DirectMessage(new NullLogger(), DI::dba(), DI::twitterUser());
$response = (new Search($directMessage, DI::dba(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Search($directMessage, DI::dba(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'searchstring' => 'test' 'searchstring' => 'test'
]); ]);

View File

@ -66,7 +66,7 @@ class NotificationTest extends ApiTest
</notes> </notes>
XML; XML;
$response = (new Notification(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml'])) $response = (new Notification(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml']))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
self::assertXmlStringEqualsXmlString($assertXml, (string)$response->getBody()); self::assertXmlStringEqualsXmlString($assertXml, (string)$response->getBody());
@ -78,7 +78,7 @@ XML;
public function testWithJsonResult() public function testWithJsonResult()
{ {
$response = (new Notification(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new Notification(DI::mstdnError(), DI::app(), 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

@ -39,7 +39,7 @@ class DeleteTest extends ApiTest
public function testEmpty() public function testEmpty()
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Delete(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))->run($this->httpExceptionMock); (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))->run($this->httpExceptionMock);
} }
public function testWithoutAuthenticatedUser() public function testWithoutAuthenticatedUser()
@ -50,14 +50,14 @@ class DeleteTest extends ApiTest
public function testWrong() public function testWrong()
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Delete(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))->run($this->httpExceptionMock, ['photo_id' => 1]); (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))->run($this->httpExceptionMock, ['photo_id' => 1]);
} }
public function testValidWithPost() public function testValidWithPost()
{ {
$this->loadFixture(__DIR__ . '/../../../../../datasets/photo/photo.fixture.php', DI::dba()); $this->loadFixture(__DIR__ . '/../../../../../datasets/photo/photo.fixture.php', DI::dba());
$response = (new Delete(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'photo_id' => '709057080661a283a6aa598501504178' 'photo_id' => '709057080661a283a6aa598501504178'
]); ]);
@ -72,7 +72,7 @@ class DeleteTest extends ApiTest
{ {
$this->loadFixture(__DIR__ . '/../../../../../datasets/photo/photo.fixture.php', DI::dba()); $this->loadFixture(__DIR__ . '/../../../../../datasets/photo/photo.fixture.php', DI::dba());
$response = (new Delete(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'photo_id' => '709057080661a283a6aa598501504178' 'photo_id' => '709057080661a283a6aa598501504178'
]); ]);

View File

@ -39,7 +39,7 @@ class DeleteTest extends ApiTest
public function testEmpty() public function testEmpty()
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Delete(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }
@ -47,7 +47,7 @@ class DeleteTest extends ApiTest
public function testWrong() public function testWrong()
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Delete(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'album' => 'album_name' 'album' => 'album_name'
]); ]);
@ -57,7 +57,7 @@ class DeleteTest extends ApiTest
{ {
$this->loadFixture(__DIR__ . '/../../../../../datasets/photo/photo.fixture.php', DI::dba()); $this->loadFixture(__DIR__ . '/../../../../../datasets/photo/photo.fixture.php', DI::dba());
$response = (new Delete(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Delete(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'album' => 'test_album'] 'album' => 'test_album']
); );

View File

@ -39,14 +39,14 @@ class UpdateTest extends ApiTest
public function testEmpty() public function testEmpty()
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Update(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Update(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }
public function testTooFewArgs() public function testTooFewArgs()
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Update(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Update(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'album' => 'album_name' 'album' => 'album_name'
]); ]);
@ -55,7 +55,7 @@ class UpdateTest extends ApiTest
public function testWrongUpdate() public function testWrongUpdate()
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Update(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Update(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'album' => 'album_name', 'album' => 'album_name',
'album_new' => 'album_name' 'album_new' => 'album_name'
@ -71,7 +71,7 @@ class UpdateTest extends ApiTest
{ {
$this->loadFixture(__DIR__ . '/../../../../../datasets/photo/photo.fixture.php', DI::dba()); $this->loadFixture(__DIR__ . '/../../../../../datasets/photo/photo.fixture.php', DI::dba());
$response = (new Update(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Update(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'album' => 'test_album', 'album' => 'test_album',
'album_new' => 'test_album_2' 'album_new' => 'test_album_2'

View File

@ -32,7 +32,7 @@ class ConfigTest extends ApiTest
*/ */
public function testApiStatusnetConfig() public function testApiStatusnetConfig()
{ {
$response = (new Config(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Config(DI::mstdnError(), DI::app(), 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

@ -30,7 +30,7 @@ class VersionTest extends ApiTest
{ {
public function test() public function test()
{ {
$response = (new Version(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new Version(DI::mstdnError(), DI::app(), 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

@ -30,7 +30,7 @@ class TestTest extends ApiTest
{ {
public function testJson() public function testJson()
{ {
$response = (new Test(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new Test(DI::mstdnError(), DI::app(), 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);
@ -44,13 +44,13 @@ class TestTest extends ApiTest
public function testXml() public function testXml()
{ {
$response = (new Test(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml'])) $response = (new Test(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml']))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
self::assertEquals([ self::assertEquals([
'Content-type' => ['text/xml'], 'Content-type' => ['text/xml'],
ICanCreateResponses::X_HEADER => ['xml'] ICanCreateResponses::X_HEADER => ['xml']
], $response->getHeaders()); ], $response->getHeaders());
self::assertxml($response->getBody(), 'ok'); self::assertXml($response->getBody(), 'ok');
} }
} }

View File

@ -35,7 +35,7 @@ class VerifyCredentialsTest extends ApiTest
*/ */
public function testApiAccountVerifyCredentials() public function testApiAccountVerifyCredentials()
{ {
$response = (new VerifyCredentials(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new VerifyCredentials(DI::mstdnError(), DI::app(), 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

@ -31,7 +31,7 @@ class RateLimitStatusTest extends ApiTest
{ {
public function testWithJson() public function testWithJson()
{ {
$response = (new RateLimitStatus(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new RateLimitStatus(DI::mstdnError(), DI::app(), 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);
@ -47,7 +47,7 @@ class RateLimitStatusTest extends ApiTest
public function testWithXml() public function testWithXml()
{ {
$response = (new RateLimitStatus(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml'])) $response = (new RateLimitStatus(DI::mstdnError(), DI::app(), 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

@ -35,7 +35,7 @@ class UpdateProfileTest extends ApiTest
{ {
$this->useHttpMethod(Router::POST); $this->useHttpMethod(Router::POST);
$response = (new UpdateProfile(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new UpdateProfile(DI::mstdnError(), DI::app(), 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

@ -33,7 +33,7 @@ class ListsTest extends ApiTest
*/ */
public function testApiStatusesFWithBlocks() public function testApiStatusesFWithBlocks()
{ {
$response = (new Lists(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Lists(DI::mstdnError(), DI::app(), 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

@ -39,7 +39,7 @@ class AllTest extends ApiTest
$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::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new All($directMessage, 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);
$json = $this->toJson($response); $json = $this->toJson($response);

View File

@ -38,7 +38,7 @@ class ConversationTest extends ApiTest
{ {
$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::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new Conversation($directMessage, 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, [
'friendica_verbose' => true, 'friendica_verbose' => true,
]); ]);

View File

@ -37,7 +37,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::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);
} }
@ -48,7 +48,7 @@ class DestroyTest extends ApiTest
*/ */
public function testApiDirectMessagesDestroyWithVerbose() public function testApiDirectMessagesDestroyWithVerbose()
{ {
$response = (new Destroy(DI::dba(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (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, [
'friendica_verbose' => true, 'friendica_verbose' => true,
]); ]);
@ -84,7 +84,7 @@ class DestroyTest extends ApiTest
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::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, [
'id' => 1 'id' => 1
]); ]);
@ -97,7 +97,7 @@ class DestroyTest extends ApiTest
*/ */
public function testApiDirectMessagesDestroyWithIdAndVerbose() public function testApiDirectMessagesDestroyWithIdAndVerbose()
{ {
$response = (new Destroy(DI::dba(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (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, [
'id' => 1, 'id' => 1,
'friendica_parenturi' => 'parent_uri', 'friendica_parenturi' => 'parent_uri',
@ -121,7 +121,7 @@ class DestroyTest extends ApiTest
$ids = DBA::selectToArray('mail', ['id']); $ids = DBA::selectToArray('mail', ['id']);
$id = $ids[0]['id']; $id = $ids[0]['id'];
$response = (new Destroy(DI::dba(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (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, [
'id' => $id, 'id' => $id,
'friendica_verbose' => true, 'friendica_verbose' => true,

View File

@ -40,7 +40,7 @@ class InboxTest extends ApiTest
$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::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new Inbox($directMessage, 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);
$json = $this->toJson($response); $json = $this->toJson($response);

View File

@ -38,7 +38,7 @@ class NewDMTest extends ApiTest
{ {
$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::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new NewDM($directMessage, 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);
self::assertEmpty((string)$response->getBody()); self::assertEmpty((string)$response->getBody());
@ -70,7 +70,7 @@ class NewDMTest extends ApiTest
{ {
$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::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new NewDM($directMessage, 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, [
'text' => 'message_text', 'text' => 'message_text',
'user_id' => 43 'user_id' => 43
@ -92,7 +92,7 @@ class NewDMTest extends ApiTest
$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::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new NewDM($directMessage, 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, [
'text' => 'message_text', 'text' => 'message_text',
'user_id' => 44 'user_id' => 44
@ -116,7 +116,7 @@ class NewDMTest extends ApiTest
$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::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new NewDM($directMessage, 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, [
'text' => 'message_text', 'text' => 'message_text',
'user_id' => 44, 'user_id' => 44,
@ -142,7 +142,7 @@ class NewDMTest extends ApiTest
$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::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'rss'])) $response = (new NewDM($directMessage, DI::dba(), DI::mstdnError(), DI::app(), 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

@ -38,7 +38,7 @@ class SentTest extends ApiTest
{ {
$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::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new Sent($directMessage, 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, [
'friendica_verbose' => true, 'friendica_verbose' => true,
]); ]);
@ -58,7 +58,7 @@ class SentTest extends ApiTest
{ {
$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::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'rss'])) $response = (new Sent($directMessage, DI::dba(), DI::mstdnError(), DI::app(), 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

@ -46,7 +46,7 @@ class CreateTest extends ApiTest
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Create(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Create(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }
@ -57,7 +57,7 @@ class CreateTest extends ApiTest
*/ */
public function testApiFavoritesCreateDestroyWithCreateAction() public function testApiFavoritesCreateDestroyWithCreateAction()
{ {
$response = (new Create(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Create(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'id' => 3 'id' => 3
]); ]);
@ -74,7 +74,7 @@ class CreateTest extends ApiTest
*/ */
public function testApiFavoritesCreateDestroyWithCreateActionAndRss() public function testApiFavoritesCreateDestroyWithCreateActionAndRss()
{ {
$response = (new Create(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => ICanCreateResponses::TYPE_RSS])) $response = (new Create(DI::mstdnError(), DI::app(), 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

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

View File

@ -36,7 +36,7 @@ class FavoritesTest extends ApiTest
*/ */
public function testApiFavorites() public function testApiFavorites()
{ {
$response = (new Favorites(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Favorites(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'page' => -1, 'page' => -1,
'max_id' => 10, 'max_id' => 10,
@ -56,7 +56,7 @@ class FavoritesTest extends ApiTest
*/ */
public function testApiFavoritesWithRss() public function testApiFavoritesWithRss()
{ {
$response = (new Favorites(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [ $response = (new Favorites(DI::mstdnError(), DI::app(), 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

@ -33,7 +33,7 @@ class ListsTest extends ApiTest
*/ */
public function testApiStatusesFWithFollowers() public function testApiStatusesFWithFollowers()
{ {
$response = (new Lists(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Lists(DI::mstdnError(), DI::app(), 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

@ -35,7 +35,7 @@ class ListsTest extends ApiTest
*/ */
public function testApiStatusesFWithFriends() public function testApiStatusesFWithFriends()
{ {
$response = (new Lists(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Lists(DI::mstdnError(), DI::app(), 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

@ -35,7 +35,7 @@ class IncomingTest extends ApiTest
*/ */
public function testApiFriendshipsIncoming() public function testApiFriendshipsIncoming()
{ {
$response = (new Incoming(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Incoming(DI::mstdnError(), DI::app(), 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

@ -38,7 +38,7 @@ class StatusesTest extends ApiTest
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Statuses(DI::dba(), DI::twitterStatus(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Statuses(DI::dba(), DI::twitterStatus(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }
@ -47,7 +47,7 @@ class StatusesTest extends ApiTest
*/ */
public function testApiListsStatusesWithListId() public function testApiListsStatusesWithListId()
{ {
$response = (new Statuses(DI::dba(), DI::twitterStatus(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Statuses(DI::dba(), DI::twitterStatus(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'list_id' => 1, 'list_id' => 1,
'page' => -1, 'page' => -1,
@ -67,7 +67,7 @@ class StatusesTest extends ApiTest
*/ */
public function testApiListsStatusesWithListIdAndRss() public function testApiListsStatusesWithListIdAndRss()
{ {
$response = (new Statuses(DI::dba(), DI::twitterStatus(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'rss'])) $response = (new Statuses(DI::dba(), DI::twitterStatus(), DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'rss']))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'list_id' => 1 'list_id' => 1
]); ]);

View File

@ -46,7 +46,7 @@ class UploadTest extends ApiTest
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Upload(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Upload(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }
@ -60,7 +60,7 @@ class UploadTest extends ApiTest
$this->expectException(UnauthorizedException::class); $this->expectException(UnauthorizedException::class);
AuthTestConfig::$authenticated = false; AuthTestConfig::$authenticated = false;
(new Upload(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Upload(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }
@ -79,7 +79,7 @@ class UploadTest extends ApiTest
] ]
]; ];
(new Upload(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Upload(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }
@ -102,7 +102,7 @@ class UploadTest extends ApiTest
] ]
]; ];
$response = (new Upload(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Upload(DI::mstdnError(), DI::app(), 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

@ -30,7 +30,7 @@ class SavedSearchesTest extends ApiTest
{ {
public function test() public function test()
{ {
$response = (new SavedSearches(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json'])) $response = (new SavedSearches(DI::mstdnError(), DI::app(), 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

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

View File

@ -36,7 +36,7 @@ class MentionsTest extends ApiTest
*/ */
public function testApiStatusesMentions() public function testApiStatusesMentions()
{ {
$response = (new Mentions(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Mentions(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'max_id' => 10 'max_id' => 10
]); ]);
@ -54,7 +54,7 @@ class MentionsTest extends ApiTest
*/ */
public function testApiStatusesMentionsWithNegativePage() public function testApiStatusesMentionsWithNegativePage()
{ {
$response = (new Mentions(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Mentions(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'page' => -2 'page' => -2
]); ]);
@ -86,7 +86,7 @@ class MentionsTest extends ApiTest
*/ */
public function testApiStatusesMentionsWithRss() public function testApiStatusesMentionsWithRss()
{ {
$response = (new Mentions(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => ICanCreateResponses::TYPE_RSS])) $response = (new Mentions(DI::mstdnError(), DI::app(), 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

@ -36,7 +36,7 @@ class NetworkPublicTimelineTest extends ApiTest
*/ */
public function testApiStatusesNetworkpublicTimeline() public function testApiStatusesNetworkpublicTimeline()
{ {
$response = (new NetworkPublicTimeline(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new NetworkPublicTimeline(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'max_id' => 10 'max_id' => 10
]); ]);
@ -58,7 +58,7 @@ class NetworkPublicTimelineTest extends ApiTest
*/ */
public function testApiStatusesNetworkpublicTimelineWithNegativePage() public function testApiStatusesNetworkpublicTimelineWithNegativePage()
{ {
$response = (new NetworkPublicTimeline(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new NetworkPublicTimeline(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'page' => -2 'page' => -2
]); ]);
@ -94,7 +94,7 @@ class NetworkPublicTimelineTest extends ApiTest
*/ */
public function testApiStatusesNetworkpublicTimelineWithRss() public function testApiStatusesNetworkpublicTimelineWithRss()
{ {
$response = (new NetworkPublicTimeline(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [ $response = (new NetworkPublicTimeline(DI::mstdnError(), DI::app(), 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, [
'page' => -2 'page' => -2

View File

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

View File

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

View File

@ -54,7 +54,7 @@ class UpdateTest extends ApiTest
] ]
]; ];
$response = (new Update(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Update(DI::mstdnError(), DI::app(), 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,
@ -76,7 +76,7 @@ class UpdateTest extends ApiTest
*/ */
public function testApiStatusesUpdateWithHtml() public function testApiStatusesUpdateWithHtml()
{ {
$response = (new Update(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Update(DI::mstdnError(), DI::app(), 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

@ -36,7 +36,7 @@ class UserTimelineTest extends ApiTest
*/ */
public function testApiStatusesUserTimeline() public function testApiStatusesUserTimeline()
{ {
$response = (new UserTimeline(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new UserTimeline(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'user_id' => 42, 'user_id' => 42,
'max_id' => 10, 'max_id' => 10,
@ -61,7 +61,7 @@ class UserTimelineTest extends ApiTest
*/ */
public function testApiStatusesUserTimelineWithNegativePage() public function testApiStatusesUserTimelineWithNegativePage()
{ {
$response = (new UserTimeline(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new UserTimeline(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'user_id' => 42, 'user_id' => 42,
'page' => -2, 'page' => -2,
@ -84,7 +84,7 @@ class UserTimelineTest extends ApiTest
*/ */
public function testApiStatusesUserTimelineWithRss() public function testApiStatusesUserTimelineWithRss()
{ {
$response = (new UserTimeline(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [ $response = (new UserTimeline(DI::mstdnError(), DI::app(), 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

@ -38,7 +38,7 @@ class LookupTest extends ApiTest
{ {
$this->expectException(NotFoundException::class); $this->expectException(NotFoundException::class);
(new Lookup(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Lookup(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }
@ -49,7 +49,7 @@ class LookupTest extends ApiTest
*/ */
public function testApiUsersLookupWithUserId() public function testApiUsersLookupWithUserId()
{ {
$response = (new Lookup(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Lookup(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'user_id' => static::OTHER_USER['id'] 'user_id' => static::OTHER_USER['id']
]); ]);

View File

@ -37,7 +37,7 @@ class SearchTest extends ApiTest
*/ */
public function testApiUsersSearch() public function testApiUsersSearch()
{ {
$response = (new Search(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Search(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'q' => static::OTHER_USER['name'] 'q' => static::OTHER_USER['name']
]); ]);
@ -54,7 +54,7 @@ class SearchTest extends ApiTest
*/ */
public function testApiUsersSearchWithXml() public function testApiUsersSearchWithXml()
{ {
$response = (new Search(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [ $response = (new Search(DI::mstdnError(), DI::app(), 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, [
'q' => static::OTHER_USER['name'] 'q' => static::OTHER_USER['name']
@ -72,7 +72,7 @@ class SearchTest extends ApiTest
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Search(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) (new Search(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock); ->run($this->httpExceptionMock);
} }
} }

View File

@ -36,7 +36,7 @@ class ShowTest extends ApiTest
*/ */
public function testApiUsersShow() public function testApiUsersShow()
{ {
$response = (new Show(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new Show(DI::mstdnError(), DI::app(), 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);
@ -56,7 +56,7 @@ class ShowTest extends ApiTest
*/ */
public function testApiUsersShowWithXml() public function testApiUsersShowWithXml()
{ {
$response = (new Show(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [ $response = (new Show(DI::mstdnError(), DI::app(), 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);