Skip to content

Commit 7534e6f

Browse files
committed
Fix test for Laravel 4.2.8
1 parent 82cab1e commit 7534e6f

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/Jenssegers/Mongodb/Connection.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,16 @@ protected function createConnection($dsn, array $config, array $options)
133133
return new MongoClient($dsn, $options);
134134
}
135135

136+
/**
137+
* Disconnect from the underlying MongoClient connection.
138+
*
139+
* @return void
140+
*/
141+
public function disconnect()
142+
{
143+
$this->connection->close();
144+
}
145+
136146
/**
137147
* Create a DSN string from a configuration.
138148
*

tests/ConnectionTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ public function testReconnect()
1515
$this->assertEquals(spl_object_hash($c1), spl_object_hash($c2));
1616

1717
$c1 = DB::connection('mongodb');
18-
$c2 = DB::reconnect('mongodb');
18+
DB::purge('mongodb');
19+
$c2 = DB::connection('mongodb');
1920
$this->assertNotEquals(spl_object_hash($c1), spl_object_hash($c2));
2021
}
2122

0 commit comments

Comments
 (0)