mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-09 16:44:26 +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
|
@ -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);
|
||||
|
||||
|
|
|
@ -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,
|
||||
]);
|
||||
|
||||
|
|
|
@ -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,
|
||||
]);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue