mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
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:
parent
56b7050858
commit
5c1d178616
1 changed files with 48 additions and 44 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
Add table
Reference in a new issue