. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Http\RequestHandlers; use Fig\Http\Message\StatusCodeInterface; use Fisharebest\Webtrees\Services\MessageService; use Fisharebest\Webtrees\Services\ModuleService; use Fisharebest\Webtrees\TestCase; use Fisharebest\Webtrees\User; use Illuminate\Support\Collection; /** * Test the AccountEdit request handler. * * @covers \Fisharebest\Webtrees\Http\RequestHandlers\AccountEdit */ class AccountEditTest extends TestCase { protected static bool $uses_database = true; /** * @return void */ public function testHandler(): void { $user = $this->createStub(User::class); $message_service = $this->createStub(MessageService::class); $module_service = $this->createStub(ModuleService::class); $module_service->method('findByInterface')->willReturn(new Collection([])); $request = self::createRequest() ->withAttribute('user', $user); $handler = new AccountEdit($message_service, $module_service); $response = $handler->handle($request); self::assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode()); } }