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 { class SessionTest extends UnitTestCase {
function setUp() { function setUp() {
$this->Session = new CakeSession(); restore_error_handler();
}
@$this->Session =& new CakeSession();
function testCheck() {
$this->Session->write('SessionTestCase', 'value'); set_error_handler('simpleTestErrorHandler');
$this->assertTrue($this->Session->check('SessionTestCase')); }
$this->assertFalse($this->Session->check('NotExistingSessionTestCase'), false); function testCheck() {
} $this->Session->write('SessionTestCase', 'value');
$this->assertTrue($this->Session->check('SessionTestCase'));
function testCheckingSavedEmpty() {
$this->Session->write('SessionTestCase', 0); $this->assertFalse($this->Session->check('NotExistingSessionTestCase'), false);
$this->assertTrue($this->Session->check('SessionTestCase')); }
$this->Session->write('SessionTestCase', '0'); function testCheckingSavedEmpty() {
$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', '0');
$this->assertTrue($this->Session->check('SessionTestCase'));
$this->Session->write('SessionTestCase', null);
$this->assertFalse($this->Session->check('SessionTestCase')); $this->Session->write('SessionTestCase', false);
} $this->assertTrue($this->Session->check('SessionTestCase'));
function testReadingSavedEmpty() { $this->Session->write('SessionTestCase', null);
$this->Session->write('SessionTestCase', 0); $this->assertFalse($this->Session->check('SessionTestCase'));
$this->assertEqual($this->Session->read('SessionTestCase'), 0); }
$this->Session->write('SessionTestCase', '0'); function testReadingSavedEmpty() {
$this->assertEqual($this->Session->read('SessionTestCase'), '0'); $this->Session->write('SessionTestCase', 0);
$this->assertFalse($this->Session->read('SessionTestCase') === 0); $this->assertEqual($this->Session->read('SessionTestCase'), 0);
$this->Session->write('SessionTestCase', false); $this->Session->write('SessionTestCase', '0');
$this->assertFalse($this->Session->read('SessionTestCase')); $this->assertEqual($this->Session->read('SessionTestCase'), '0');
$this->assertFalse($this->Session->read('SessionTestCase') === 0);
$this->Session->write('SessionTestCase', null);
$this->assertEqual($this->Session->read('SessionTestCase'), null); $this->Session->write('SessionTestCase', false);
} $this->assertFalse($this->Session->read('SessionTestCase'));
function tearDown() { $this->Session->write('SessionTestCase', null);
$this->Session->del('SessionTestCase'); $this->assertEqual($this->Session->read('SessionTestCase'), null);
unset($this->Session); }
}
function tearDown() {
$this->Session->del('SessionTestCase');
unset($this->Session);
}
} }
?> ?>