17c4add84SGreg Roach<?php 27c4add84SGreg Roach 37c4add84SGreg Roach/** 47c4add84SGreg Roach * webtrees: online genealogy 5*5e933c21SGreg Roach * Copyright (C) 2020 webtrees development team 67c4add84SGreg Roach * This program is free software: you can redistribute it and/or modify 77c4add84SGreg Roach * it under the terms of the GNU General Public License as published by 87c4add84SGreg Roach * the Free Software Foundation, either version 3 of the License, or 97c4add84SGreg Roach * (at your option) any later version. 107c4add84SGreg Roach * This program is distributed in the hope that it will be useful, 117c4add84SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 127c4add84SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 137c4add84SGreg Roach * GNU General Public License for more details. 147c4add84SGreg Roach * You should have received a copy of the GNU General Public License 157c4add84SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>. 167c4add84SGreg Roach */ 177c4add84SGreg Roach 187c4add84SGreg Roachdeclare(strict_types=1); 197c4add84SGreg Roach 207c4add84SGreg Roachnamespace Fisharebest\Webtrees\Http\Controllers\Admin; 217c4add84SGreg Roach 227c4add84SGreg Roachuse Fig\Http\Message\StatusCodeInterface; 237c4add84SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\AccountEdit; 24f91b18ebSGreg Roachuse Fisharebest\Webtrees\Services\EmailService; 25f91b18ebSGreg Roachuse Fisharebest\Webtrees\Services\MessageService; 26150f35adSGreg Roachuse Fisharebest\Webtrees\Services\ModuleService; 27f91b18ebSGreg Roachuse Fisharebest\Webtrees\Services\UserService; 287c4add84SGreg Roachuse Fisharebest\Webtrees\TestCase; 297c4add84SGreg Roachuse Fisharebest\Webtrees\User; 307c4add84SGreg Roach 317c4add84SGreg Roach/** 327c4add84SGreg Roach * Test the AccountEdit request handler. 337c4add84SGreg Roach * 347c4add84SGreg Roach * @covers \Fisharebest\Webtrees\Http\RequestHandlers\AccountEdit 357c4add84SGreg Roach */ 367c4add84SGreg Roachclass AccountEditTest extends TestCase 377c4add84SGreg Roach{ 387c4add84SGreg Roach protected static $uses_database = true; 397c4add84SGreg Roach 407c4add84SGreg Roach /** 417c4add84SGreg Roach * @return void 427c4add84SGreg Roach */ 437c4add84SGreg Roach public function testHandler(): void 447c4add84SGreg Roach { 45*5e933c21SGreg Roach $user = self::createMock(User::class); 46f91b18ebSGreg Roach $handler = new AccountEdit(new MessageService(new EmailService(), new UserService()), new ModuleService()); 477c4add84SGreg Roach $request = self::createRequest() 487c4add84SGreg Roach ->withAttribute('user', $user); 497c4add84SGreg Roach $response = $handler->handle($request); 507c4add84SGreg Roach 51*5e933c21SGreg Roach self::assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode()); 527c4add84SGreg Roach } 537c4add84SGreg Roach} 54