. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Http\Controllers\Admin; use Fig\Http\Message\StatusCodeInterface; use Fisharebest\Webtrees\Http\RequestHandlers\AccountEdit; use Fisharebest\Webtrees\Services\EmailService; use Fisharebest\Webtrees\Services\MessageService; use Fisharebest\Webtrees\Services\ModuleService; use Fisharebest\Webtrees\Services\UserService; use Fisharebest\Webtrees\TestCase; use Fisharebest\Webtrees\User; /** * Test the AccountEdit request handler. * * @covers \Fisharebest\Webtrees\Http\RequestHandlers\AccountEdit */ class AccountEditTest extends TestCase { protected static $uses_database = true; /** * @return void */ public function testHandler(): void { $user = $this->createMock(User::class); $handler = new AccountEdit(new MessageService(new EmailService(), new UserService()), new ModuleService()); $request = self::createRequest() ->withAttribute('user', $user); $response = $handler->handle($request); $this->assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode()); } }