Use X-REQUEST-ID for Error pages

This commit is contained in:
Philipp 2022-12-26 21:17:32 +01:00
parent 5584e7a4e5
commit 4f1bb0d274
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
55 changed files with 218 additions and 130 deletions

View file

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

View file

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

View file

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

View file

@ -40,7 +40,7 @@ class AllTest extends ApiTest
$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']))
->run();
->run($this->httpExceptionMock);
$json = $this->toJson($response);

View file

@ -39,7 +39,7 @@ class ConversationTest extends ApiTest
$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']))
->run([
->run($this->httpExceptionMock, [
'friendica_verbose' => true,
]);

View file

@ -38,7 +38,7 @@ class DestroyTest extends ApiTest
{
$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']))
->run();
->run($this->httpExceptionMock);
}
/**
@ -49,7 +49,7 @@ class DestroyTest extends ApiTest
public function testApiDirectMessagesDestroyWithVerbose()
{
$response = (new Destroy(DI::dba(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
->run([
->run($this->httpExceptionMock, [
'friendica_verbose' => true,
]);
@ -85,7 +85,7 @@ class DestroyTest extends ApiTest
{
$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']))
->run([
->run($this->httpExceptionMock, [
'id' => 1
]);
}
@ -98,7 +98,7 @@ class DestroyTest extends ApiTest
public function testApiDirectMessagesDestroyWithIdAndVerbose()
{
$response = (new Destroy(DI::dba(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
->run([
->run($this->httpExceptionMock, [
'id' => 1,
'friendica_parenturi' => 'parent_uri',
'friendica_verbose' => true,
@ -122,7 +122,7 @@ class DestroyTest extends ApiTest
$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']))
->run([
->run($this->httpExceptionMock, [
'id' => $id,
'friendica_verbose' => true,
]);

View file

@ -41,7 +41,7 @@ class InboxTest extends ApiTest
$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']))
->run();
->run($this->httpExceptionMock);
$json = $this->toJson($response);

View file

@ -39,7 +39,7 @@ class NewDMTest extends ApiTest
$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']))
->run();
->run($this->httpExceptionMock);
self::assertEmpty((string)$response->getBody());
}
@ -71,7 +71,7 @@ class NewDMTest extends ApiTest
$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']))
->run([
->run($this->httpExceptionMock, [
'text' => 'message_text',
'user_id' => 43
]);
@ -93,7 +93,7 @@ class NewDMTest extends ApiTest
$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']))
->run([
->run($this->httpExceptionMock, [
'text' => 'message_text',
'user_id' => 44
]);
@ -117,7 +117,7 @@ class NewDMTest extends ApiTest
$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']))
->run([
->run($this->httpExceptionMock, [
'text' => 'message_text',
'user_id' => 44,
'title' => 'message_title',
@ -143,7 +143,7 @@ class NewDMTest extends ApiTest
$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']))
->run([
->run($this->httpExceptionMock, [
'text' => 'message_text',
'user_id' => 44,
'title' => 'message_title',

View file

@ -39,7 +39,7 @@ class SentTest extends ApiTest
$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']))
->run([
->run($this->httpExceptionMock, [
'friendica_verbose' => true,
]);
@ -59,7 +59,7 @@ class SentTest extends ApiTest
$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']))
->run();
->run($this->httpExceptionMock);
self::assertXml((string)$response->getBody(), 'direct-messages');
}

View file

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

View file

@ -46,7 +46,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(), []))
->run();
->run($this->httpExceptionMock);
}
/**
@ -57,7 +57,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(), []))
->run([
->run($this->httpExceptionMock, [
'id' => 3
]);

View file

@ -37,7 +37,7 @@ class FavoritesTest extends ApiTest
public function testApiFavorites()
{
$response = (new Favorites(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run([
->run($this->httpExceptionMock, [
'page' => -1,
'max_id' => 10,
]);
@ -58,7 +58,7 @@ class FavoritesTest extends ApiTest
{
$response = (new Favorites(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [
'extension' => ICanCreateResponses::TYPE_RSS
]))->run();
]))->run($this->httpExceptionMock);
self::assertEquals(ICanCreateResponses::TYPE_RSS, $response->getHeaderLine(ICanCreateResponses::X_HEADER));

View file

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

View file

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

View file

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

View file

@ -39,7 +39,7 @@ class StatusesTest extends ApiTest
$this->expectException(BadRequestException::class);
(new Statuses(DI::dba(), DI::twitterStatus(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run();
->run($this->httpExceptionMock);
}
/**
@ -48,7 +48,7 @@ class StatusesTest extends ApiTest
public function testApiListsStatusesWithListId()
{
$response = (new Statuses(DI::dba(), DI::twitterStatus(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run([
->run($this->httpExceptionMock, [
'list_id' => 1,
'page' => -1,
'max_id' => 10
@ -68,7 +68,7 @@ class StatusesTest extends ApiTest
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']))
->run([
->run($this->httpExceptionMock, [
'list_id' => 1
]);

View file

@ -47,7 +47,7 @@ class UploadTest extends ApiTest
$this->expectException(BadRequestException::class);
(new Upload(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run();
->run($this->httpExceptionMock);
}
/**
@ -61,7 +61,7 @@ class UploadTest extends ApiTest
AuthTestConfig::$authenticated = false;
(new Upload(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run();
->run($this->httpExceptionMock);
}
/**
@ -80,7 +80,7 @@ class UploadTest extends ApiTest
];
(new Upload(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run();
->run($this->httpExceptionMock);
}
/**
@ -103,7 +103,7 @@ class UploadTest extends ApiTest
];
$response = (new Upload(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run();
->run($this->httpExceptionMock);
$media = $this->toJson($response);

View file

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

View file

@ -46,7 +46,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(), []))
->run();
->run($this->httpExceptionMock);
}
/**
@ -72,7 +72,7 @@ class DestroyTest extends ApiTest
public function testApiStatusesDestroyWithId()
{
$response = (new Destroy(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run([
->run($this->httpExceptionMock, [
'id' => 1
]);

View file

@ -37,7 +37,7 @@ class MentionsTest extends ApiTest
public function testApiStatusesMentions()
{
$response = (new Mentions(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run([
->run($this->httpExceptionMock, [
'max_id' => 10
]);
@ -55,7 +55,7 @@ class MentionsTest extends ApiTest
public function testApiStatusesMentionsWithNegativePage()
{
$response = (new Mentions(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run([
->run($this->httpExceptionMock, [
'page' => -2
]);
@ -87,7 +87,7 @@ class MentionsTest extends ApiTest
public function testApiStatusesMentionsWithRss()
{
$response = (new Mentions(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => ICanCreateResponses::TYPE_RSS]))
->run([
->run($this->httpExceptionMock, [
'page' => -2
]);

View file

@ -37,7 +37,7 @@ class NetworkPublicTimelineTest extends ApiTest
public function testApiStatusesNetworkpublicTimeline()
{
$response = (new NetworkPublicTimeline(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run([
->run($this->httpExceptionMock, [
'max_id' => 10
]);
@ -59,7 +59,7 @@ class NetworkPublicTimelineTest extends ApiTest
public function testApiStatusesNetworkpublicTimelineWithNegativePage()
{
$response = (new NetworkPublicTimeline(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run([
->run($this->httpExceptionMock, [
'page' => -2
]);
@ -96,7 +96,7 @@ class NetworkPublicTimelineTest extends ApiTest
{
$response = (new NetworkPublicTimeline(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [
'extension' => ICanCreateResponses::TYPE_RSS
]))->run([
]))->run($this->httpExceptionMock, [
'page' => -2
]);

View file

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

View file

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

View file

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

View file

@ -37,7 +37,7 @@ class UserTimelineTest extends ApiTest
public function testApiStatusesUserTimeline()
{
$response = (new UserTimeline(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run([
->run($this->httpExceptionMock, [
'user_id' => 42,
'max_id' => 10,
'exclude_replies' => true,
@ -62,7 +62,7 @@ class UserTimelineTest extends ApiTest
public function testApiStatusesUserTimelineWithNegativePage()
{
$response = (new UserTimeline(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run([
->run($this->httpExceptionMock, [
'user_id' => 42,
'page' => -2,
]);
@ -86,7 +86,7 @@ class UserTimelineTest extends ApiTest
{
$response = (new UserTimeline(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [
'extension' => ICanCreateResponses::TYPE_RSS
]))->run();
]))->run($this->httpExceptionMock);
self::assertEquals(ICanCreateResponses::TYPE_RSS, $response->getHeaderLine(ICanCreateResponses::X_HEADER));

View file

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

View file

@ -38,7 +38,7 @@ class SearchTest extends ApiTest
public function testApiUsersSearch()
{
$respone = (new Search(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run([
->run($this->httpExceptionMock, [
'q' => static::OTHER_USER['name']
]);
@ -56,7 +56,7 @@ class SearchTest extends ApiTest
{
$respone = (new Search(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [
'extension' => ICanCreateResponses::TYPE_XML
]))->run([
]))->run($this->httpExceptionMock, [
'q' => static::OTHER_USER['name']
]);
@ -73,6 +73,6 @@ class SearchTest extends ApiTest
$this->expectException(BadRequestException::class);
(new Search(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run();
->run($this->httpExceptionMock);
}
}

View file

@ -37,7 +37,7 @@ class ShowTest extends ApiTest
public function testApiUsersShow()
{
$response = (new Show(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run();
->run($this->httpExceptionMock);
$json = $this->toJson($response);
@ -58,7 +58,7 @@ class ShowTest extends ApiTest
{
$response = (new Show(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [
'extension' => ICanCreateResponses::TYPE_XML
]))->run();
]))->run($this->httpExceptionMock);
self::assertEquals(ICanCreateResponses::TYPE_XML, $response->getHeaderLine(ICanCreateResponses::X_HEADER));