From a9d77d26f036fcb964071e485343c81d1656c57d Mon Sep 17 00:00:00 2001 From: Highstrike Date: Thu, 25 Jun 2015 13:40:50 +0300 Subject: [PATCH] fix failing tests fixing... --- .../Console/Command/Task/ProjectTaskTest.php | 1 - .../Component/AuthComponentTest.php | 30 +++++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php index b288b9cd7..15ec76798 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php @@ -197,7 +197,6 @@ class ProjectTaskTest extends CakeTestCase { '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', diff --git a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php index 89341b4e0..27e20abfb 100644 --- a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php @@ -165,7 +165,7 @@ class AuthTestController extends Controller { * * @var array */ - public $components = array('Session', 'Auth'); + public $components = array('Session', 'Flash', 'Auth'); /** * testUrl property @@ -1093,9 +1093,9 @@ class AuthComponentTest extends CakeTestCase { 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) ); @@ -1105,8 +1105,8 @@ class AuthComponentTest extends CakeTestCase { $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); } @@ -1132,9 +1132,9 @@ class AuthComponentTest extends CakeTestCase { 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) ); @@ -1144,8 +1144,8 @@ class AuthComponentTest extends CakeTestCase { $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); } @@ -1514,10 +1514,10 @@ class AuthComponentTest extends CakeTestCase { * @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',