From 59fc4fb522dd041effb64956ab1c4e9dcb607660 Mon Sep 17 00:00:00 2001 From: mscherer Date: Tue, 24 Sep 2024 01:36:40 +0200 Subject: [PATCH] Add test --- tests/TestCase/Auth/FormAuthenticateTest.php | 34 ++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/TestCase/Auth/FormAuthenticateTest.php diff --git a/tests/TestCase/Auth/FormAuthenticateTest.php b/tests/TestCase/Auth/FormAuthenticateTest.php new file mode 100644 index 00000000..b2b299aa --- /dev/null +++ b/tests/TestCase/Auth/FormAuthenticateTest.php @@ -0,0 +1,34 @@ + + */ + protected array $fixtures = [ + 'plugin.TinyAuth.Users', + ]; + + /** + * @return void + */ + public function testAuthenticate() { + $request = new ServerRequest(); + $request = $request->withData('username', 'dereuromark'); + $request = $request->withData('password', '123'); + + $object = new FormAuthenticate(new ComponentRegistry(new Controller($request))); + $result = $object->authenticate($request, new Response()); + $this->assertTrue((bool)$result); + } + +}