Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
fixing...
  • Loading branch information
highstrike committed Jun 25, 2015
1 parent 8257100 commit a9d77d2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ public function testBakeEmptyFlag() {
'Test' . DS . 'Case' . DS . 'View' . DS . 'Helper' => 'empty',
'Test' . DS . 'Fixture' => 'empty',
'Vendor' => 'empty',
'View' . DS . 'Elements' => 'empty',
'View' . DS . 'Scaffolds' => 'empty',
'tmp' . DS . 'cache' . DS . 'models' => 'empty',
'tmp' . DS . 'cache' . DS . 'persistent' => 'empty',
Expand Down
30 changes: 15 additions & 15 deletions lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class AuthTestController extends Controller {
*
* @var array
*/
public $components = array('Session', 'Auth');
public $components = array('Session', 'Flash', 'Auth');

/**
* testUrl property
Expand Down Expand Up @@ -1093,9 +1093,9 @@ public function testRedirectToUnauthorizedRedirect() {
array('on', 'redirect'),
array($CakeRequest, $CakeResponse)
);
$this->Auth->Session = $this->getMock(
'SessionComponent',
array('setFlash'),
$this->Auth->Flash = $this->getMock(
'FlashComponent',
array('set'),
array($Controller->Components)
);

Expand All @@ -1105,8 +1105,8 @@ public function testRedirectToUnauthorizedRedirect() {
$Controller->expects($this->once())
->method('redirect')
->with($this->equalTo($expected));
$this->Auth->Session->expects($this->once())
->method('setFlash');
$this->Auth->Flash->expects($this->once())
->method('set');
$this->Auth->startup($Controller);
}

Expand All @@ -1132,9 +1132,9 @@ public function testRedirectToUnauthorizedRedirectSuppressedAuthError() {
array('on', 'redirect'),
array($CakeRequest, $CakeResponse)
);
$this->Auth->Session = $this->getMock(
'SessionComponent',
array('setFlash'),
$this->Auth->Flash = $this->getMock(
'FlashComponent',
array('set'),
array($Controller->Components)
);

Expand All @@ -1144,8 +1144,8 @@ public function testRedirectToUnauthorizedRedirectSuppressedAuthError() {
$Controller->expects($this->once())
->method('redirect')
->with($this->equalTo($expected));
$this->Auth->Session->expects($this->never())
->method('setFlash');
$this->Auth->Flash->expects($this->never())
->method('set');
$this->Auth->startup($Controller);
}

Expand Down Expand Up @@ -1514,10 +1514,10 @@ public function testLoginWithUserData() {
* @return void
*/
public function testFlashSettings() {
$this->Auth->Session = $this->getMock('SessionComponent', array(), array(), '', false);
$this->Auth->Session->expects($this->once())
->method('setFlash')
->with('Auth failure', 'custom', array(1), 'auth-key');
$this->Auth->Flash = $this->getMock('FlashComponent', array(), array(), '', false);
$this->Auth->Flash->expects($this->once())
->method('set')
->with('Auth failure', array('element' => 'custom', 'params' => array(1), 'key' => 'auth-key'));

$this->Auth->flash = array(
'element' => 'custom',
Expand Down

0 comments on commit a9d77d2

Please sign in to comment.