Skip to content
Permalink
Browse files

Fix failing tests due to adding aliases to Authorize and Authenticate…

… providers
  • Loading branch information...
Walther Lalk
Walther Lalk committed Sep 1, 2014
1 parent a250027 commit ddde891c6bf5e2f5ca95fb6217b0f344028ecb87
@@ -335,7 +335,7 @@ protected function _unauthenticated(Controller $controller) {
if (empty($this->_authenticateObjects)) {
$this->constructAuthenticate();
}
$auth = $this->_authenticateObjects[count($this->_authenticateObjects) - 1];
$auth = end($this->_authenticateObjects);
$result = $auth->unauthenticated($this->request, $this->response);
if ($result !== null) {
return $result;
@@ -317,7 +317,7 @@ public function testAllConfigWithAuthorize() {
AuthComponent::ALL => array('actionPath' => 'controllers/'),
'Controller',
]);
$objects = $this->Controller->Auth->constructAuthorize();
$objects = array_values($this->Controller->Auth->constructAuthorize());
$result = $objects[0];
$this->assertEquals('controllers/', $result->config('actionPath'));
}
@@ -346,7 +346,7 @@ public function testAllConfigWithAuthenticate() {
AuthComponent::ALL => array('userModel' => 'AuthUsers'),
'Form'
]);
$objects = $this->Controller->Auth->constructAuthenticate();
$objects = array_values($this->Controller->Auth->constructAuthenticate());
$result = $objects[0];
$this->assertEquals('AuthUsers', $result->config('userModel'));
}
@@ -365,11 +365,11 @@ public function testSameAuthenticateWithDifferentHashers() {
$objects = $this->Controller->Auth->constructAuthenticate();
$this->assertEquals(2, count($objects));
$this->assertInstanceOf('Cake\Auth\FormAuthenticate', $objects[0]);
$this->assertInstanceOf('Cake\Auth\FormAuthenticate', $objects[1]);
$this->assertInstanceOf('Cake\Auth\FormAuthenticate', $objects['FormSimple']);
$this->assertInstanceOf('Cake\Auth\FormAuthenticate', $objects['FormBlowfish']);
$this->assertInstanceOf('Cake\Auth\DefaultPasswordHasher', $objects[0]->passwordHasher());
$this->assertInstanceOf('Cake\Auth\FallbackPasswordHasher', $objects[1]->passwordHasher());
$this->assertInstanceOf('Cake\Auth\DefaultPasswordHasher', $objects['FormSimple']->passwordHasher());
$this->assertInstanceOf('Cake\Auth\FallbackPasswordHasher', $objects['FormBlowfish']->passwordHasher());
}
/**

0 comments on commit ddde891

Please sign in to comment.
You can’t perform that action at this time.