mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Adding tests for using a custom session config with CacheSession.
This commit is contained in:
parent
49397c74af
commit
736d33647e
1 changed files with 31 additions and 0 deletions
|
@ -571,6 +571,37 @@ class CakeSessionTest extends CakeTestCase {
|
|||
$this->assertNull(TestCakeSession::read('SessionTestCase'));
|
||||
}
|
||||
|
||||
/**
|
||||
* test that changing the config name of the cache config works.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function testReadAndWriteWithCustomCacheConfig() {
|
||||
session_write_close();
|
||||
Configure::write('Session.defaults', 'cache');
|
||||
Configure::write('Session.handler.config', 'session_test');
|
||||
|
||||
Cache::config('session_test', array(
|
||||
'engine' => 'File',
|
||||
'prefix' => 'session_test_',
|
||||
));
|
||||
|
||||
TestCakeSession::init();
|
||||
TestCakeSession::destroy();
|
||||
|
||||
TestCakeSession::write('SessionTestCase', 'Some value');
|
||||
$this->assertEquals('Some value', TestCakeSession::read('SessionTestCase'));
|
||||
|
||||
session_write_close();
|
||||
|
||||
$this->assertContains('Some value', Cache::read(TestCakeSession::id(), 'session_test'));
|
||||
$this->assertFalse(Cache::read(TestCakeSession::id(), 'default'));
|
||||
|
||||
TestCakeSession::destroy();
|
||||
Cache::delete(TestCakeSession::id(), 'session_test');
|
||||
Cache::drop('session_test');
|
||||
}
|
||||
|
||||
/**
|
||||
* testReadAndWriteWithDatabaseStorage method
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue