mirror of
https://github.com/friendica/friendica
synced 2025-04-29 08:24:23 +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
|
@ -24,16 +24,28 @@ namespace Friendica\Test\src\Module\Special;
|
|||
use Friendica\App\Router;
|
||||
use Friendica\Capabilities\ICanCreateResponses;
|
||||
use Friendica\DI;
|
||||
use Friendica\Module\Special\HTTPException;
|
||||
use Friendica\Module\Special\Options;
|
||||
use Friendica\Test\FixtureTest;
|
||||
use Mockery\MockInterface;
|
||||
|
||||
class OptionsTest extends FixtureTest
|
||||
{
|
||||
/** @var MockInterface|HTTPException */
|
||||
protected $httpExceptionMock;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->httpExceptionMock = \Mockery::mock(HTTPException::class);
|
||||
}
|
||||
|
||||
public function testOptionsAll()
|
||||
{
|
||||
$this->useHttpMethod(Router::OPTIONS);
|
||||
|
||||
$response = (new Options(DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))->run();
|
||||
$response = (new Options(DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))->run($this->httpExceptionMock);
|
||||
|
||||
self::assertEmpty((string)$response->getBody());
|
||||
self::assertEquals(204, $response->getStatusCode());
|
||||
|
@ -51,7 +63,7 @@ class OptionsTest extends FixtureTest
|
|||
|
||||
$response = (new Options(DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], [
|
||||
'AllowedMethods' => [Router::GET, Router::POST],
|
||||
]))->run();
|
||||
]))->run($this->httpExceptionMock);
|
||||
|
||||
self::assertEmpty((string)$response->getBody());
|
||||
self::assertEquals(204, $response->getStatusCode());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue