-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c2bd0c
commit 59fc4fb
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace TinyAuth\Test\TestCase\Auth; | ||
|
||
use Cake\Controller\ComponentRegistry; | ||
use Cake\Controller\Controller; | ||
use Cake\Http\Response; | ||
use Cake\Http\ServerRequest; | ||
use Cake\TestSuite\TestCase; | ||
use TinyAuth\Auth\FormAuthenticate; | ||
|
||
class FormAuthenticateTest extends TestCase { | ||
|
||
/** | ||
* @var array<string> | ||
*/ | ||
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); | ||
} | ||
|
||
} |