Dependency updates and update version number

This commit is contained in:
Kode
2018-06-13 19:35:28 +01:00
parent 18ec208381
commit e3ec7de23a
1261 changed files with 45582 additions and 29687 deletions

View File

@@ -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);
}
}

View File

@@ -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();

View File

@@ -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
*/