Skip to content

Commit 59fc4fb

Browse files
committed
Add test
1 parent 6c2bd0c commit 59fc4fb

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
}

0 commit comments

Comments
 (0)