Preventing session started messages in session test

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4775 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
mariano.iglesias 2007-04-05 04:27:44 +00:00
parent 56b7050858
commit 5c1d178616

View file

@ -36,50 +36,54 @@
*/
class SessionTest extends UnitTestCase {
function setUp() {
$this->Session = new CakeSession();
}
function testCheck() {
$this->Session->write('SessionTestCase', 'value');
$this->assertTrue($this->Session->check('SessionTestCase'));
$this->assertFalse($this->Session->check('NotExistingSessionTestCase'), false);
}
function testCheckingSavedEmpty() {
$this->Session->write('SessionTestCase', 0);
$this->assertTrue($this->Session->check('SessionTestCase'));
$this->Session->write('SessionTestCase', '0');
$this->assertTrue($this->Session->check('SessionTestCase'));
$this->Session->write('SessionTestCase', false);
$this->assertTrue($this->Session->check('SessionTestCase'));
$this->Session->write('SessionTestCase', null);
$this->assertFalse($this->Session->check('SessionTestCase'));
}
function testReadingSavedEmpty() {
$this->Session->write('SessionTestCase', 0);
$this->assertEqual($this->Session->read('SessionTestCase'), 0);
$this->Session->write('SessionTestCase', '0');
$this->assertEqual($this->Session->read('SessionTestCase'), '0');
$this->assertFalse($this->Session->read('SessionTestCase') === 0);
$this->Session->write('SessionTestCase', false);
$this->assertFalse($this->Session->read('SessionTestCase'));
$this->Session->write('SessionTestCase', null);
$this->assertEqual($this->Session->read('SessionTestCase'), null);
}
function tearDown() {
$this->Session->del('SessionTestCase');
unset($this->Session);
}
function setUp() {
restore_error_handler();
@$this->Session =& new CakeSession();
set_error_handler('simpleTestErrorHandler');
}
function testCheck() {
$this->Session->write('SessionTestCase', 'value');
$this->assertTrue($this->Session->check('SessionTestCase'));
$this->assertFalse($this->Session->check('NotExistingSessionTestCase'), false);
}
function testCheckingSavedEmpty() {
$this->Session->write('SessionTestCase', 0);
$this->assertTrue($this->Session->check('SessionTestCase'));
$this->Session->write('SessionTestCase', '0');
$this->assertTrue($this->Session->check('SessionTestCase'));
$this->Session->write('SessionTestCase', false);
$this->assertTrue($this->Session->check('SessionTestCase'));
$this->Session->write('SessionTestCase', null);
$this->assertFalse($this->Session->check('SessionTestCase'));
}
function testReadingSavedEmpty() {
$this->Session->write('SessionTestCase', 0);
$this->assertEqual($this->Session->read('SessionTestCase'), 0);
$this->Session->write('SessionTestCase', '0');
$this->assertEqual($this->Session->read('SessionTestCase'), '0');
$this->assertFalse($this->Session->read('SessionTestCase') === 0);
$this->Session->write('SessionTestCase', false);
$this->assertFalse($this->Session->read('SessionTestCase'));
$this->Session->write('SessionTestCase', null);
$this->assertEqual($this->Session->read('SessionTestCase'), null);
}
function tearDown() {
$this->Session->del('SessionTestCase');
unset($this->Session);
}
}
?>