mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-11 06:04:27 +02:00
Use X-REQUEST-ID for Error pages
This commit is contained in:
parent
5584e7a4e5
commit
4f1bb0d274
55 changed files with 218 additions and 130 deletions
|
@ -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
|
||||
]);
|
||||
|
||||
|
|
|
@ -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
|
||||
]);
|
||||
|
||||
|
|
|
@ -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
|
||||
]);
|
||||
|
||||
|
|
|
@ -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
|
||||
]);
|
||||
|
||||
|
|
|
@ -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
|
||||
]);
|
||||
|
|
|
@ -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>',
|
||||
]);
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue