-
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.
Merge pull request #147 from dereuromark/depr
Remove deprecation.
- Loading branch information
Showing
7 changed files
with
54 additions
and
5 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
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
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 |
---|---|---|
|
@@ -17,6 +17,7 @@ class UsersFixture extends TestFixture { | |
public array $fields = [ | ||
'id' => ['type' => 'integer'], | ||
'username' => ['type' => 'string', 'null' => false, 'length' => 64, 'comment' => '', 'charset' => 'utf8'], | ||
'email' => ['type' => 'string', 'null' => false, 'length' => 64, 'comment' => '', 'charset' => 'utf8'], | ||
'role_id' => ['type' => 'integer', 'null' => false, 'default' => '0', 'length' => 11, 'collate' => null, 'comment' => ''], | ||
'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], | ||
]; | ||
|
@@ -30,16 +31,19 @@ class UsersFixture extends TestFixture { | |
[ | ||
'id' => '1', | ||
'username' => 'dereuromark', | ||
'email' => '[email protected]', | ||
'role_id' => ROLE_USER, | ||
], | ||
[ | ||
'id' => '2', | ||
'username' => 'bravo-kernel', | ||
'email' => '[email protected]', | ||
'role_id' => ROLE_ADMIN, | ||
], | ||
[ | ||
'id' => '3', | ||
'username' => 'adriana', | ||
'email' => '[email protected]', | ||
'role_id' => ROLE_MODERATOR, | ||
], | ||
]; | ||
|
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,45 @@ | ||
<?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\MultiColumnAuthenticate; | ||
|
||
/** | ||
* Test case for TinyAuth Authentication | ||
*/ | ||
class MultiColumnAuthenticateTest extends TestCase { | ||
|
||
/** | ||
* @var array<string> | ||
*/ | ||
protected array $fixtures = [ | ||
'plugin.TinyAuth.Users', | ||
]; | ||
|
||
/** | ||
* Test applying config in the constructor | ||
* | ||
* @return void | ||
*/ | ||
public function testGetUser() { | ||
$request = new ServerRequest(); | ||
$request = $request->withData('login', 'dereuromark'); | ||
$request = $request->withData('password', '123'); | ||
|
||
$object = new MultiColumnAuthenticate(new ComponentRegistry(new Controller($request)), [ | ||
'fields' => [ | ||
'username' => 'login', | ||
'password' => 'password', | ||
], | ||
'columns' => ['username', 'email'], | ||
]); | ||
$result = $object->authenticate($request, new Response()); | ||
$this->assertFalse($result); | ||
} | ||
|
||
} |
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
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
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