Updating tests to reflect API deprecations.

This commit is contained in:
mark_story 2009-08-31 22:50:46 -04:00
parent b5605b6408
commit 4ee70c01a8
2 changed files with 9 additions and 40 deletions
cake
libs/controller/components
tests/cases/libs/controller/components

View file

@ -1,6 +1,4 @@
<?php <?php
/* SVN FILE: $Id$ */
/** /**
* Short description for file. * Short description for file.
* *
@ -9,20 +7,17 @@
* PHP versions 4 and 5 * PHP versions 4 and 5
* *
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* *
* Licensed under The MIT License * Licensed under The MIT License
* Redistributions of files must retain the above copyright notice. * Redistributions of files must retain the above copyright notice.
* *
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake * @package cake
* @subpackage cake.cake.libs.controller.components * @subpackage cake.cake.libs.controller.components
* @since CakePHP(tm) v 0.10.0.1232 * @since CakePHP(tm) v 0.10.0.1232
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License * @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/ */
if (!class_exists('cakesession')) { if (!class_exists('cakesession')) {

View file

@ -1,6 +1,4 @@
<?php <?php
/* SVN FILE: $Id$ */
/** /**
* SessionComponentTest file * SessionComponentTest file
* *
@ -9,20 +7,17 @@
* PHP versions 4 and 5 * PHP versions 4 and 5
* *
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* *
* Licensed under The Open Group Test Suite License * Licensed under The Open Group Test Suite License
* Redistributions of files must retain the above copyright notice. * Redistributions of files must retain the above copyright notice.
* *
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
* @since CakePHP(tm) v 1.2.0.5436 * @since CakePHP(tm) v 1.2.0.5436
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/ */
App::import('Controller', 'Controller', false); App::import('Controller', 'Controller', false);
@ -247,24 +242,24 @@ class SessionComponentTest extends CakeTestCase {
$this->assertTrue($Session->write('Test', 'some value')); $this->assertTrue($Session->write('Test', 'some value'));
$this->assertEqual($Session->read('Test'), 'some value'); $this->assertEqual($Session->read('Test'), 'some value');
$this->assertFalse($Session->write('Test.key', 'some value')); $this->assertFalse($Session->write('Test.key', 'some value'));
$Session->del('Test'); $Session->delete('Test');
$this->assertTrue($Session->write('Test.key.path', 'some value')); $this->assertTrue($Session->write('Test.key.path', 'some value'));
$this->assertEqual($Session->read('Test.key.path'), 'some value'); $this->assertEqual($Session->read('Test.key.path'), 'some value');
$this->assertEqual($Session->read('Test.key'), array('path' => 'some value')); $this->assertEqual($Session->read('Test.key'), array('path' => 'some value'));
$this->assertTrue($Session->write('Test.key.path2', 'another value')); $this->assertTrue($Session->write('Test.key.path2', 'another value'));
$this->assertEqual($Session->read('Test.key'), array('path' => 'some value', 'path2' => 'another value')); $this->assertEqual($Session->read('Test.key'), array('path' => 'some value', 'path2' => 'another value'));
$Session->del('Test'); $Session->delete('Test');
$array = array('key1' => 'val1', 'key2' => 'val2', 'key3' => 'val3'); $array = array('key1' => 'val1', 'key2' => 'val2', 'key3' => 'val3');
$this->assertTrue($Session->write('Test', $array)); $this->assertTrue($Session->write('Test', $array));
$this->assertEqual($Session->read('Test'), $array); $this->assertEqual($Session->read('Test'), $array);
$Session->del('Test'); $Session->delete('Test');
$this->assertFalse($Session->write(array('Test'), 'some value')); $this->assertFalse($Session->write(array('Test'), 'some value'));
$this->assertTrue($Session->write(array('Test' => 'some value'))); $this->assertTrue($Session->write(array('Test' => 'some value')));
$this->assertEqual($Session->read('Test'), 'some value'); $this->assertEqual($Session->read('Test'), 'some value');
$Session->del('Test'); $Session->delete('Test');
Configure::write('Session.start', false); Configure::write('Session.start', false);
$Session =& new SessionComponent(); $Session =& new SessionComponent();
@ -274,27 +269,6 @@ class SessionComponentTest extends CakeTestCase {
Configure::write('Session.start', true); Configure::write('Session.start', true);
} }
/**
* testSessionDel method
*
* @access public
* @return void
*/
function testSessionDel() {
$Session =& new SessionComponent();
$this->assertFalse($Session->del('Test'));
$Session->write('Test', 'some value');
$this->assertTrue($Session->del('Test'));
Configure::write('Session.start', false);
$Session =& new SessionComponent();
$Session->write('Test', 'some value');
$this->assertFalse($Session->del('Test'));
Configure::write('Session.start', true);
}
/** /**
* testSessionDelete method * testSessionDelete method
* *
@ -361,7 +335,7 @@ class SessionComponentTest extends CakeTestCase {
$Session->setFlash('This is a test message', 'non_existing_layout'); $Session->setFlash('This is a test message', 'non_existing_layout');
$this->assertEqual($Session->read('Message.myFlash'), array('message' => 'This is a test message', 'layout' => 'default', 'params' => array())); $this->assertEqual($Session->read('Message.myFlash'), array('message' => 'This is a test message', 'layout' => 'default', 'params' => array()));
$Session->del('Message'); $Session->delete('Message');
} }
/** /**