|
|
@@ -365,13 +365,16 @@ class SessionTest extends TestCase {
|
|
|
$config = [
|
|
|
'defaults' => 'cake',
|
|
|
'handler' => array(
|
|
|
- 'engine' => 'TestAppLibSession'
|
|
|
+ 'engine' => 'TestAppLibSession',
|
|
|
+ 'these' => 'are',
|
|
|
+ 'a few' => 'options'
|
|
|
)
|
|
|
];
|
|
|
|
|
|
$session = Session::create($config);
|
|
|
$this->assertInstanceOf('TestApp\Network\Session\TestAppLibSession', $session->engine());
|
|
|
$this->assertEquals('user', ini_get('session.save_handler'));
|
|
|
+ $this->assertEquals(['these' => 'are', 'a few' => 'options'], $session->engine()->options);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -396,6 +399,22 @@ class SessionTest extends TestCase {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Tests that it is possible to pass an already made instance as the session engine
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function testEngineWithPreMadeInstance() {
|
|
|
+ \Cake\Core\Configure::write('App.namespace', 'TestApp');
|
|
|
+ $engine = new \TestApp\Network\Session\TestAppLibSession;
|
|
|
+ $session = new Session(['handler' => ['engine' => $engine]]);
|
|
|
+ $this->assertSame($engine, $session->engine());
|
|
|
+
|
|
|
+ $session = new Session();
|
|
|
+ $session->engine($engine);
|
|
|
+ $this->assertSame($engine, $session->engine());
|
|
|
+ }
|
|
|
+
|
|
|
+/**
|
|
|
* Test that cookieTimeout matches timeout when unspecified.
|
|
|
*
|
|
|
* @return void
|