Skip to content

Commit

Permalink
Adding a couple assertions to test the new AuthComponent methods
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jun 5, 2014
1 parent bbf7575 commit e53f572
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Controller/Component/AuthComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,6 @@ public function loginProvider() {
* @return \Cake\Auth\BaseAuthorize|null
*/
public function authorizationProvider() {
return $this->_authenticateProvider;
return $this->_authorizationProvider;
}
}
2 changes: 2 additions & 0 deletions tests/TestCase/Controller/Component/AuthComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ public function testLogin() {

$this->assertTrue((bool)$this->Auth->user());
$this->assertEquals($user, $this->Auth->user());
$this->assertSame($AuthLoginFormAuthenticate, $this->Auth->loginProvider());
}

/**
Expand Down Expand Up @@ -273,6 +274,7 @@ public function testIsAuthorizedDelegation() {
->method('authorize');

$this->assertTrue($this->Auth->isAuthorized(array('User'), $request));
$this->assertSame($AuthMockTwoAuthorize, $this->Auth->authorizationProvider());
}

/**
Expand Down

0 comments on commit e53f572

Please sign in to comment.