mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-03 13:40:00 +09:00
Dependency updates and update version number
This commit is contained in:
@@ -32,7 +32,7 @@ class NativeSessionHandlerTest extends TestCase
|
||||
{
|
||||
$handler = new NativeSessionHandler();
|
||||
|
||||
$this->assertTrue($handler instanceof \SessionHandler);
|
||||
$this->assertInstanceOf('SessionHandler', $handler);
|
||||
$this->assertTrue($handler instanceof NativeSessionHandler);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,6 +324,41 @@ class PdoSessionHandlerTest extends TestCase
|
||||
$this->assertInstanceOf('\PDO', $method->invoke($storage));
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider provideUrlDsnPairs
|
||||
*/
|
||||
public function testUrlDsn($url, $expectedDsn, $expectedUser = null, $expectedPassword = null)
|
||||
{
|
||||
$storage = new PdoSessionHandler($url);
|
||||
|
||||
$this->assertAttributeEquals($expectedDsn, 'dsn', $storage);
|
||||
|
||||
if (null !== $expectedUser) {
|
||||
$this->assertAttributeEquals($expectedUser, 'username', $storage);
|
||||
}
|
||||
|
||||
if (null !== $expectedPassword) {
|
||||
$this->assertAttributeEquals($expectedPassword, 'password', $storage);
|
||||
}
|
||||
}
|
||||
|
||||
public function provideUrlDsnPairs()
|
||||
{
|
||||
yield array('mysql://localhost/test', 'mysql:host=localhost;dbname=test;');
|
||||
yield array('mysql://localhost:56/test', 'mysql:host=localhost;port=56;dbname=test;');
|
||||
yield array('mysql2://root:pwd@localhost/test', 'mysql:host=localhost;dbname=test;', 'root', 'pwd');
|
||||
yield array('postgres://localhost/test', 'pgsql:host=localhost;dbname=test;');
|
||||
yield array('postgresql://localhost:5634/test', 'pgsql:host=localhost;port=5634;dbname=test;');
|
||||
yield array('postgres://root:pwd@localhost/test', 'pgsql:host=localhost;dbname=test;', 'root', 'pwd');
|
||||
yield 'sqlite relative path' => array('sqlite://localhost/tmp/test', 'sqlite:tmp/test');
|
||||
yield 'sqlite absolute path' => array('sqlite://localhost//tmp/test', 'sqlite:/tmp/test');
|
||||
yield 'sqlite relative path without host' => array('sqlite:///tmp/test', 'sqlite:tmp/test');
|
||||
yield 'sqlite absolute path without host' => array('sqlite3:////tmp/test', 'sqlite:/tmp/test');
|
||||
yield array('sqlite://localhost/:memory:', 'sqlite::memory:');
|
||||
yield array('mssql://localhost/test', 'sqlsrv:server=localhost;Database=test');
|
||||
yield array('mssql://localhost:56/test', 'sqlsrv:server=localhost,56;Database=test');
|
||||
}
|
||||
|
||||
private function createStream($content)
|
||||
{
|
||||
$stream = tmpfile();
|
||||
|
||||
@@ -182,6 +182,23 @@ class NativeSessionStorageTest extends TestCase
|
||||
$this->assertEquals($options, $gco);
|
||||
}
|
||||
|
||||
public function testSessionOptions()
|
||||
{
|
||||
if (defined('HHVM_VERSION')) {
|
||||
$this->markTestSkipped('HHVM is not handled in this test case.');
|
||||
}
|
||||
|
||||
$options = array(
|
||||
'url_rewriter.tags' => 'a=href',
|
||||
'cache_expire' => '200',
|
||||
);
|
||||
|
||||
$this->getStorage($options);
|
||||
|
||||
$this->assertSame('a=href', ini_get('url_rewriter.tags'));
|
||||
$this->assertSame('200', ini_get('session.cache_expire'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user