/** * tearDown method * * @return void */ public function teardown() { if (TestCakeSession::started()) { TestCakeSession::clear(); } unset($_SESSION); parent::teardown(); }
/** * testClear method * * @return void */ public function testClear() { $this->assertTrue(TestCakeSession::write('Delete.me', 'Clearing out')); TestCakeSession::clear(false); $this->assertFalse(TestCakeSession::check('Delete.me')); $this->assertFalse(TestCakeSession::check('Delete')); TestCakeSession::write('Some.string', 'value'); TestCakeSession::clear(false); $this->assertNull(TestCakeSession::read('Some')); TestCakeSession::write('Some.string.array', array('values')); TestCakeSession::clear(false); $this->assertFalse(TestCakeSession::read()); }