Commit 7534e6f9 authored by Jens Segers's avatar Jens Segers

Fix test for Laravel 4.2.8

parent 82cab1e3
...@@ -133,6 +133,16 @@ class Connection extends \Illuminate\Database\Connection { ...@@ -133,6 +133,16 @@ class Connection extends \Illuminate\Database\Connection {
return new MongoClient($dsn, $options); return new MongoClient($dsn, $options);
} }
/**
* Disconnect from the underlying MongoClient connection.
*
* @return void
*/
public function disconnect()
{
$this->connection->close();
}
/** /**
* Create a DSN string from a configuration. * Create a DSN string from a configuration.
* *
......
...@@ -15,7 +15,8 @@ class ConnectionTest extends TestCase { ...@@ -15,7 +15,8 @@ class ConnectionTest extends TestCase {
$this->assertEquals(spl_object_hash($c1), spl_object_hash($c2)); $this->assertEquals(spl_object_hash($c1), spl_object_hash($c2));
$c1 = DB::connection('mongodb'); $c1 = DB::connection('mongodb');
$c2 = DB::reconnect('mongodb'); DB::purge('mongodb');
$c2 = DB::connection('mongodb');
$this->assertNotEquals(spl_object_hash($c1), spl_object_hash($c2)); $this->assertNotEquals(spl_object_hash($c1), spl_object_hash($c2));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment