diff options
| author | Greg Roach <fisharebest@webtrees.net> | 2019-11-07 17:51:55 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@webtrees.net> | 2019-11-07 21:05:52 +0000 |
| commit | 7c4add84379afdbaa7c4c272763673edc20fb830 (patch) | |
| tree | f8089d82fa08ab0e0f763e4e5b4dbfe4814a0a9f /tests/app/Http/RequestHandlers/AccountEditTest.php | |
| parent | a32e67c745176498fa0b89cfb76e553aa066d4f4 (diff) | |
| download | webtrees-7c4add84379afdbaa7c4c272763673edc20fb830.tar.gz webtrees-7c4add84379afdbaa7c4c272763673edc20fb830.tar.bz2 webtrees-7c4add84379afdbaa7c4c272763673edc20fb830.zip | |
Fix error updating account preferences; use constants for preference names
Diffstat (limited to 'tests/app/Http/RequestHandlers/AccountEditTest.php')
| -rw-r--r-- | tests/app/Http/RequestHandlers/AccountEditTest.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/app/Http/RequestHandlers/AccountEditTest.php b/tests/app/Http/RequestHandlers/AccountEditTest.php new file mode 100644 index 0000000000..30e05b9d78 --- /dev/null +++ b/tests/app/Http/RequestHandlers/AccountEditTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2019 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Http\Controllers\Admin; + +use Fig\Http\Message\StatusCodeInterface; +use Fisharebest\Webtrees\Http\RequestHandlers\AccountEdit; +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(); + $request = self::createRequest() + ->withAttribute('user', $user); + $response = $handler->handle($request); + + $this->assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode()); + } +} |
