File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -571,6 +571,37 @@ function testReadAndWriteWithCacheStorage() {
571
571
$ this ->assertNull (TestCakeSession::read ('SessionTestCase ' ));
572
572
}
573
573
574
+ /**
575
+ * test that changing the config name of the cache config works.
576
+ *
577
+ * @return void
578
+ */
579
+ function testReadAndWriteWithCustomCacheConfig () {
580
+ session_write_close ();
581
+ Configure::write ('Session.defaults ' , 'cache ' );
582
+ Configure::write ('Session.handler.config ' , 'session_test ' );
583
+
584
+ Cache::config ('session_test ' , array (
585
+ 'engine ' => 'File ' ,
586
+ 'prefix ' => 'session_test_ ' ,
587
+ ));
588
+
589
+ TestCakeSession::init ();
590
+ TestCakeSession::destroy ();
591
+
592
+ TestCakeSession::write ('SessionTestCase ' , 'Some value ' );
593
+ $ this ->assertEquals ('Some value ' , TestCakeSession::read ('SessionTestCase ' ));
594
+
595
+ session_write_close ();
596
+
597
+ $ this ->assertContains ('Some value ' , Cache::read (TestCakeSession::id (), 'session_test ' ));
598
+ $ this ->assertFalse (Cache::read (TestCakeSession::id (), 'default ' ));
599
+
600
+ TestCakeSession::destroy ();
601
+ Cache::delete (TestCakeSession::id (), 'session_test ' );
602
+ Cache::drop ('session_test ' );
603
+ }
604
+
574
605
/**
575
606
* testReadAndWriteWithDatabaseStorage method
576
607
*
You can’t perform that action at this time.
0 commit comments