diff options
| author | Greg Roach <fisharebest@webtrees.net> | 2019-02-01 15:30:34 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@webtrees.net> | 2019-02-01 15:30:34 +0000 |
| commit | 4c3fdcde56e8ab380ab1a8f5ea6a669f954e61b2 (patch) | |
| tree | e0cace8adbb27fa0342711864239a7aa359c9647 /tests/app | |
| parent | 350ffb989b31cd28295dce731ed1037b8469fc53 (diff) | |
| download | webtrees-4c3fdcde56e8ab380ab1a8f5ea6a669f954e61b2.tar.gz webtrees-4c3fdcde56e8ab380ab1a8f5ea6a669f954e61b2.tar.bz2 webtrees-4c3fdcde56e8ab380ab1a8f5ea6a669f954e61b2.zip | |
Refactor admin controller
Diffstat (limited to 'tests/app')
| -rw-r--r-- | tests/app/Http/Controllers/Admin/ImportThumbnailsControllerTest.php | 27 | ||||
| -rw-r--r-- | tests/app/Http/Controllers/Admin/UsersControllerTest.php | 118 |
2 files changed, 120 insertions, 25 deletions
diff --git a/tests/app/Http/Controllers/Admin/ImportThumbnailsControllerTest.php b/tests/app/Http/Controllers/Admin/ImportThumbnailsControllerTest.php index f955182e2f..ee019b622d 100644 --- a/tests/app/Http/Controllers/Admin/ImportThumbnailsControllerTest.php +++ b/tests/app/Http/Controllers/Admin/ImportThumbnailsControllerTest.php @@ -31,34 +31,11 @@ class ImportThumbnailsControllerTest extends \Fisharebest\Webtrees\TestCase /** * @return void */ - public function testWebtrees1Thumbnails(): void + public function testIndex(): void { $controller = app()->make(ImportThumbnailsController::class); - $response = app()->dispatch($controller, 'webtrees1Thumbnails'); + $response = app()->dispatch($controller, 'index'); $this->assertInstanceOf(Response::class, $response); } - - /** - * @return void - */ - public function testWebtrees1ThumbnailsAction(): void - { - $controller = app()->make(ImportThumbnailsController::class); - $response = app()->dispatch($controller, 'webtrees1ThumbnailsAction'); - - $this->assertInstanceOf(Response::class, $response); - } - - /** - * @return void - */ - public function testWebtrees1ThumbnailsData(): void - { - // Can't test this yet - the query uses MySQL-specific functions - //$controller = app()->make(ImportThumbnailsController::class); - //$response = app()->dispatch($controller, 'webtrees1ThumbnailsData'); - - //$this->assertInstanceOf(Response::class, $response); - } } diff --git a/tests/app/Http/Controllers/Admin/UsersControllerTest.php b/tests/app/Http/Controllers/Admin/UsersControllerTest.php new file mode 100644 index 0000000000..59545f5112 --- /dev/null +++ b/tests/app/Http/Controllers/Admin/UsersControllerTest.php @@ -0,0 +1,118 @@ +<?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 Symfony\Component\HttpFoundation\Response; + +/** + * Test UsersController class. + * + * @covers \Fisharebest\Webtrees\Http\Controllers\Admin\UsersController + */ +class UsersControllerTest extends \Fisharebest\Webtrees\TestCase +{ + protected static $uses_database = true; + + /** + * @return void + */ + public function testIndex(): void + { + $controller = app()->make(UsersController::class); + $response = app()->dispatch($controller, 'index'); + + $this->assertInstanceOf(Response::class, $response); + } + + /** + * @return void + */ + public function testData(): void + { + $controller = app()->make(UsersController::class); + $response = app()->dispatch($controller, 'data'); + + $this->assertInstanceOf(Response::class, $response); + } + + /** + * @return void + */ + public function testCreate(): void + { + $controller = app()->make(UsersController::class); + $response = app()->dispatch($controller, 'create'); + + $this->assertInstanceOf(Response::class, $response); + } + + /** + * @return void + */ + public function testSave(): void + { + $controller = app()->make(UsersController::class); + $response = app()->dispatch($controller, 'save'); + + $this->assertInstanceOf(Response::class, $response); + } + + /** + * @return void + */ + public function testEdit(): void + { + $controller = app()->make(UsersController::class); + $response = app()->dispatch($controller, 'edit'); + + $this->assertInstanceOf(Response::class, $response); + } + + /** + * @return void + */ + public function testUpdate(): void + { + $controller = app()->make(UsersController::class); + $response = app()->dispatch($controller, 'update'); + + $this->assertInstanceOf(Response::class, $response); + } + + /** + * @return void + */ + public function testCleanup(): void + { + $controller = app()->make(UsersController::class); + $response = app()->dispatch($controller, 'cleanup'); + + $this->assertInstanceOf(Response::class, $response); + } + + /** + * @return void + */ + public function testCleanupAction(): void + { + $controller = app()->make(UsersController::class); + $response = app()->dispatch($controller, 'cleanupAction'); + + $this->assertInstanceOf(Response::class, $response); + } +} |
