File tree 1 file changed +34
-0
lines changed
1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace TinyAuth \Test \TestCase \Auth ;
4
+
5
+ use Cake \Controller \ComponentRegistry ;
6
+ use Cake \Controller \Controller ;
7
+ use Cake \Http \Response ;
8
+ use Cake \Http \ServerRequest ;
9
+ use Cake \TestSuite \TestCase ;
10
+ use TinyAuth \Auth \FormAuthenticate ;
11
+
12
+ class FormAuthenticateTest extends TestCase {
13
+
14
+ /**
15
+ * @var array<string>
16
+ */
17
+ protected array $ fixtures = [
18
+ 'plugin.TinyAuth.Users ' ,
19
+ ];
20
+
21
+ /**
22
+ * @return void
23
+ */
24
+ public function testAuthenticate () {
25
+ $ request = new ServerRequest ();
26
+ $ request = $ request ->withData ('username ' , 'dereuromark ' );
27
+ $ request = $ request ->withData ('password ' , '123 ' );
28
+
29
+ $ object = new FormAuthenticate (new ComponentRegistry (new Controller ($ request )));
30
+ $ result = $ object ->authenticate ($ request , new Response ());
31
+ $ this ->assertTrue ((bool )$ result );
32
+ }
33
+
34
+ }
You can’t perform that action at this time.
0 commit comments