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

@ -27,12 +27,14 @@ use Friendica\Core\Addon;
use Friendica\Core\Hook;
use Friendica\Database\Database;
use Friendica\DI;
use Friendica\Module\Special\HTTPException;
use Friendica\Security\Authentication;
use Friendica\Security\BasicAuth;
use Friendica\Test\FixtureTest;
use Friendica\Test\Util\AppDouble;
use Friendica\Test\Util\AuthenticationDouble;
use Friendica\Test\Util\AuthTestConfig;
use Mockery\MockInterface;
use Psr\Http\Message\ResponseInterface;
abstract class ApiTest extends FixtureTest
@ -59,6 +61,9 @@ abstract class ApiTest extends FixtureTest
'nurl' => 'http://localhost/profile/othercontact'
];
/** @var HTTPException */
protected $httpExceptionMock;
// User ID that we know is not in the database
const WRONG_USER_ID = 666;
@ -175,6 +180,8 @@ abstract class ApiTest extends FixtureTest
// Manual override to bypass API authentication
DI::app()->setIsLoggedIn(true);
$this->httpExceptionMock = $this->dice->create(HTTPException::class);
AuthTestConfig::$authenticated = true;
AuthTestConfig::$user_id = 42;