/**
  * testReadAndWriteWithDatabaseStorage method
  *
  * @return void
  */
 public function testReadAndWriteWithDatabaseStorage()
 {
     Configure::write('Session.defaults', 'database');
     Configure::write('Session.handler.engine', 'TestDatabaseSession');
     Configure::write('Session.handler.table', 'sessions');
     Configure::write('Session.handler.model', 'Session');
     Configure::write('Session.handler.database', 'test');
     TestCakeSession::init();
     $this->assertNull(TestCakeSession::id());
     TestCakeSession::start();
     $expected = session_id();
     $this->assertEquals($expected, TestCakeSession::id());
     TestCakeSession::renew();
     $this->assertFalse($expected === TestCakeSession::id());
     $expected = session_id();
     $this->assertEquals($expected, TestCakeSession::id());
     TestCakeSession::write('SessionTestCase', 0);
     $this->assertEquals(0, TestCakeSession::read('SessionTestCase'));
     TestCakeSession::write('SessionTestCase', '0');
     $this->assertEquals('0', TestCakeSession::read('SessionTestCase'));
     $this->assertFalse(TestCakeSession::read('SessionTestCase') === 0);
     TestCakeSession::write('SessionTestCase', false);
     $this->assertFalse(TestCakeSession::read('SessionTestCase'));
     TestCakeSession::write('SessionTestCase', null);
     $this->assertEquals(null, TestCakeSession::read('SessionTestCase'));
     TestCakeSession::write('SessionTestCase', 'This is a Test');
     $this->assertEquals('This is a Test', TestCakeSession::read('SessionTestCase'));
     TestCakeSession::write('SessionTestCase', 'Some additional data');
     $this->assertEquals('Some additional data', TestCakeSession::read('SessionTestCase'));
     TestCakeSession::destroy();
     $this->assertNull(TestCakeSession::read('SessionTestCase'));
     Configure::write('Session', array('defaults' => 'php'));
     TestCakeSession::init();
 }