Skip to content

Commit

Permalink
Adding tests for getting session id when using DatabaseSession. Dispr…
Browse files Browse the repository at this point in the history
…oves #2734
  • Loading branch information
ADmad committed Mar 30, 2012
1 parent 65f25ed commit 1763219
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php
Expand Up @@ -477,7 +477,7 @@ public function testCheckUserAgentTrue() {
}

/**
* testReadAndWriteWithDatabaseStorage method
* testReadAndWriteWithCakeStorage method
*
* @return void
*/
Expand Down Expand Up @@ -560,7 +560,7 @@ public function testUsingPluginHandler() {
}

/**
* testReadAndWriteWithDatabaseStorage method
* testReadAndWriteWithCacheStorage method
*
* @return void
*/
Expand Down Expand Up @@ -630,7 +630,17 @@ public function testReadAndWriteWithDatabaseStorage() {
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'));
Expand Down

0 comments on commit 1763219

Please sign in to comment.