. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Http\RequestHandlers; use Fig\Http\Message\RequestMethodInterface; use Fig\Http\Message\StatusCodeInterface; use Fisharebest\Webtrees\Services\UserService; use Fisharebest\Webtrees\TestCase; /** * Test UserAddActionTest class. * * @covers \Fisharebest\Webtrees\Http\RequestHandlers\UserAddAction */ class UserAddActionTest extends TestCase { protected static bool $uses_database = true; public function testHandler(): void { $user_service = new UserService(); $handler = new UserAddAction($user_service); $request = self::createRequest(RequestMethodInterface::METHOD_POST, [], [ 'username' => 'User name', 'email' => 'email@example.com', 'real_name' => 'Real Name', 'password' => 'Secret1234', ]); $response = $handler->handle($request); self::assertSame(StatusCodeInterface::STATUS_FOUND, $response->getStatusCode()); } }