|
|
@@ -75,8 +75,8 @@ class FormAuthenticateTest extends TestCase
|
|
|
'userModel' => 'AuthUsers',
|
|
|
'fields' => ['username' => 'user', 'password' => 'password']
|
|
|
]);
|
|
|
- $this->assertEquals('AuthUsers', $object->config('userModel'));
|
|
|
- $this->assertEquals(['username' => 'user', 'password' => 'password'], $object->config('fields'));
|
|
|
+ $this->assertEquals('AuthUsers', $object->getConfig('userModel'));
|
|
|
+ $this->assertEquals(['username' => 'user', 'password' => 'password'], $object->getConfig('fields'));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -259,7 +259,7 @@ class FormAuthenticateTest extends TestCase
|
|
|
$user['password'] = password_hash(Security::getSalt() . 'cake', PASSWORD_BCRYPT);
|
|
|
$PluginModel->save(new Entity($user));
|
|
|
|
|
|
- $this->auth->config('userModel', 'TestPlugin.AuthUsers');
|
|
|
+ $this->auth->setConfig('userModel', 'TestPlugin.AuthUsers');
|
|
|
|
|
|
$request = new ServerRequest('posts/index');
|
|
|
$request->data = [
|
|
|
@@ -291,7 +291,7 @@ class FormAuthenticateTest extends TestCase
|
|
|
'password' => 'password'
|
|
|
];
|
|
|
|
|
|
- $this->auth->config([
|
|
|
+ $this->auth->setConfig([
|
|
|
'userModel' => 'AuthUsers',
|
|
|
'finder' => 'auth'
|
|
|
]);
|
|
|
@@ -303,7 +303,7 @@ class FormAuthenticateTest extends TestCase
|
|
|
];
|
|
|
$this->assertEquals($expected, $result, 'Result should not contain "created" and "modified" fields');
|
|
|
|
|
|
- $this->auth->config([
|
|
|
+ $this->auth->setConfig([
|
|
|
'finder' => ['auth' => ['return_created' => true]]
|
|
|
]);
|
|
|
|
|
|
@@ -329,7 +329,7 @@ class FormAuthenticateTest extends TestCase
|
|
|
'password' => 'password'
|
|
|
];
|
|
|
|
|
|
- $this->auth->config([
|
|
|
+ $this->auth->setConfig([
|
|
|
'userModel' => 'AuthUsers',
|
|
|
'finder' => 'username'
|
|
|
]);
|
|
|
@@ -341,7 +341,7 @@ class FormAuthenticateTest extends TestCase
|
|
|
];
|
|
|
$this->assertEquals($expected, $result);
|
|
|
|
|
|
- $this->auth->config([
|
|
|
+ $this->auth->setConfig([
|
|
|
'finder' => ['username' => ['username' => 'nate']]
|
|
|
]);
|
|
|
|
|
|
@@ -360,13 +360,13 @@ class FormAuthenticateTest extends TestCase
|
|
|
*/
|
|
|
public function testPasswordHasherSettings()
|
|
|
{
|
|
|
- $this->auth->config('passwordHasher', [
|
|
|
+ $this->auth->setConfig('passwordHasher', [
|
|
|
'className' => 'Default',
|
|
|
'hashType' => PASSWORD_BCRYPT
|
|
|
]);
|
|
|
|
|
|
$passwordHasher = $this->auth->passwordHasher();
|
|
|
- $result = $passwordHasher->config();
|
|
|
+ $result = $passwordHasher->getConfig();
|
|
|
$this->assertEquals(PASSWORD_BCRYPT, $result['hashType']);
|
|
|
|
|
|
$hash = password_hash('mypass', PASSWORD_BCRYPT);
|
|
|
@@ -395,7 +395,7 @@ class FormAuthenticateTest extends TestCase
|
|
|
'fields' => ['username' => 'username', 'password' => 'password'],
|
|
|
'userModel' => 'Users'
|
|
|
]);
|
|
|
- $this->auth->config('passwordHasher', [
|
|
|
+ $this->auth->setConfig('passwordHasher', [
|
|
|
'className' => 'Default'
|
|
|
]);
|
|
|
$this->assertEquals($expected, $this->auth->authenticate($request, $this->response));
|