Skip to content

Commit

Permalink
Fix test for Laravel 4.2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
jenssegers committed Aug 6, 2014
1 parent 82cab1e commit 7534e6f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/Jenssegers/Mongodb/Connection.php
Expand Up @@ -133,6 +133,16 @@ protected function createConnection($dsn, array $config, array $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.
*
Expand Down
3 changes: 2 additions & 1 deletion tests/ConnectionTest.php
Expand Up @@ -15,7 +15,8 @@ public function testReconnect()
$this->assertEquals(spl_object_hash($c1), spl_object_hash($c2));

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

Expand Down

0 comments on commit 7534e6f

Please sign in to comment.