X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fsymfony%2Fhttp-foundation%2FTests%2FSession%2FStorage%2FHandler%2FMongoDbSessionHandlerTest.php;h=128b9b52f505f79b7a4c53033c6121f844edd7b7;hp=f23161c10b0762ed28654f13609e1c9acbf2797b;hb=eba34333e3c89f208d2f72fa91351ad019a71583;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php index f23161c10..128b9b52f 100644 --- a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php +++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php @@ -31,7 +31,11 @@ class MongoDbSessionHandlerTest extends TestCase { parent::setUp(); - if (!extension_loaded('mongo') && !extension_loaded('mongodb')) { + if (extension_loaded('mongodb')) { + if (!class_exists('MongoDB\Client')) { + $this->markTestSkipped('The mongodb/mongodb package is required.'); + } + } elseif (!extension_loaded('mongo')) { $this->markTestSkipped('The Mongo or MongoDB extension is required.'); } @@ -109,7 +113,7 @@ class MongoDbSessionHandlerTest extends TestCase if (phpversion('mongodb')) { $that->assertInstanceOf('MongoDB\BSON\UTCDateTime', $criteria[$that->options['expiry_field']]['$gte']); - $that->assertGreaterThanOrEqual(round(((int) $criteria[$that->options['expiry_field']]['$gte']) / 1000), $testTimeout); + $that->assertGreaterThanOrEqual(round((string) $criteria[$that->options['expiry_field']]['$gte'] / 1000), $testTimeout); } else { $that->assertInstanceOf('MongoDate', $criteria[$that->options['expiry_field']]['$gte']); $that->assertGreaterThanOrEqual($criteria[$that->options['expiry_field']]['$gte']->sec, $testTimeout); @@ -168,7 +172,7 @@ class MongoDbSessionHandlerTest extends TestCase $that->assertEquals('bar', $data[$that->options['data_field']]->getData()); $that->assertInstanceOf('MongoDB\BSON\UTCDateTime', $data[$that->options['time_field']]); $that->assertInstanceOf('MongoDB\BSON\UTCDateTime', $data[$that->options['expiry_field']]); - $that->assertGreaterThanOrEqual($expectedExpiry, round(((int) $data[$that->options['expiry_field']]) / 1000)); + $that->assertGreaterThanOrEqual($expectedExpiry, round((string) $data[$that->options['expiry_field']] / 1000)); } else { $that->assertEquals('bar', $data[$that->options['data_field']]->bin); $that->assertInstanceOf('MongoDate', $data[$that->options['time_field']]); @@ -294,7 +298,7 @@ class MongoDbSessionHandlerTest extends TestCase ->will($this->returnCallback(function ($criteria) use ($that) { if (phpversion('mongodb')) { $that->assertInstanceOf('MongoDB\BSON\UTCDateTime', $criteria[$that->options['expiry_field']]['$lt']); - $that->assertGreaterThanOrEqual(time() - 1, round(((int) $criteria[$that->options['expiry_field']]['$lt']) / 1000)); + $that->assertGreaterThanOrEqual(time() - 1, round((string) $criteria[$that->options['expiry_field']]['$lt'] / 1000)); } else { $that->assertInstanceOf('MongoDate', $criteria[$that->options['expiry_field']]['$lt']); $that->assertGreaterThanOrEqual(time() - 1, $criteria[$that->options['expiry_field']]['$lt']->sec);