|
|
@@ -225,40 +225,4 @@ class BasicAuthenticateTest extends TestCase {
|
|
|
$this->auth->unauthenticated($request, $this->response);
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * testAuthenticateWithBlowfish
|
|
|
- *
|
|
|
- * @return void
|
|
|
- */
|
|
|
- public function testAuthenticateWithBlowfish() {
|
|
|
- $hash = Security::hash('password', 'blowfish');
|
|
|
- $this->skipIf(strpos($hash, '$2y$') === false, 'Skipping blowfish tests as hashing is not working');
|
|
|
-
|
|
|
- $request = new Request([
|
|
|
- 'url' => 'posts/index',
|
|
|
- 'environment' => [
|
|
|
- 'PHP_AUTH_USER' => 'mariano',
|
|
|
- 'PHP_AUTH_PW' => 'password'
|
|
|
- ]
|
|
|
- ]);
|
|
|
- $request->addParams(array('pass' => array()));
|
|
|
-
|
|
|
- $User = TableRegistry::get('Users');
|
|
|
- $User->updateAll(
|
|
|
- array('password' => $hash),
|
|
|
- array('username' => 'mariano')
|
|
|
- );
|
|
|
-
|
|
|
- $this->auth->config('passwordHasher', 'Blowfish');
|
|
|
-
|
|
|
- $result = $this->auth->authenticate($request, $this->response);
|
|
|
- $expected = array(
|
|
|
- 'id' => 1,
|
|
|
- 'username' => 'mariano',
|
|
|
- 'created' => new Time('2007-03-17 01:16:23'),
|
|
|
- 'updated' => new Time('2007-03-17 01:18:31')
|
|
|
- );
|
|
|
- $this->assertEquals($expected, $result);
|
|
|
- }
|
|
|
-
|
|
|
}
|