Move App::uses() again

This commit is contained in:
Sebastien Barre 2014-11-05 13:46:45 -05:00
parent 4c59ab6eca
commit f78e6c0621
2 changed files with 2 additions and 2 deletions

View file

@ -26,6 +26,7 @@ App::uses('Hash', 'Utility');
App::uses('CakeSession', 'Model/Datasource');
App::uses('BaseAuthorize', 'Controller/Component/Auth');
App::uses('BaseAuthenticate', 'Controller/Component/Auth');
App::uses('CakeEvent', 'Event');
/**
* Authentication control component class
@ -608,7 +609,6 @@ class AuthComponent extends Component {
if ($user) {
$this->Session->renew();
$this->Session->write(self::$sessionKey, $user);
App::uses('CakeEvent', 'Event');
$event = new CakeEvent('Auth.afterIdentify', $this, array('user' => $user));
$this->_Collection->getController()->getEventManager()->dispatch($event);
}

View file

@ -20,7 +20,6 @@ App::uses('Controller', 'Controller');
App::uses('AuthComponent', 'Controller/Component');
App::uses('AclComponent', 'Controller/Component');
App::uses('FormAuthenticate', 'Controller/Component/Auth');
App::uses('CakeEvent', 'Event');
/**
* TestAuthComponent class
@ -429,6 +428,7 @@ class AuthComponentTest extends CakeTestCase {
$manager = $this->Controller->getEventManager();
$listener = $this->getMock('AuthEventTestListener');
$manager->attach(array($listener, 'listenerFunction'), 'Auth.afterIdentify');
App::uses('CakeEvent', 'Event');
$event = new CakeEvent('Auth.afterIdentify', $this->Auth, array('user' => $user));
$listener->expects($this->once())->method('listenerFunction')->with($event);