diff --git a/src/Lunr/Gravity/Database/MySQL/Tests/Helpers/AbstractMySQLDatabaseAccessObjectTest.php b/src/Lunr/Gravity/Database/MySQL/Tests/Helpers/AbstractMySQLDatabaseAccessObjectTest.php
index dabcb2d5e586db54b33eaf0e662d40a1cafc783a..525ae03e61ee5e8f2e5290c21d41e1a520c8371b 100644
--- a/src/Lunr/Gravity/Database/MySQL/Tests/Helpers/AbstractMySQLDatabaseAccessObjectTest.php
+++ b/src/Lunr/Gravity/Database/MySQL/Tests/Helpers/AbstractMySQLDatabaseAccessObjectTest.php
@@ -73,7 +73,7 @@ abstract class AbstractMySQLDatabaseAccessObjectTest extends LunrBaseTest
                              ->disableOriginalConstructor()
                              ->getMock();
 
-        $this->logger = $this->getMock('Psr\Log\LoggerInterface');
+        $this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
 
         $this->db->expects($this->at(0))
                  ->method('get_query_escaper_object')
diff --git a/src/Lunr/Gravity/Database/MySQL/Tests/Helpers/MySQLDatabaseAccessObjectTest.php b/src/Lunr/Gravity/Database/MySQL/Tests/Helpers/MySQLDatabaseAccessObjectTest.php
index 988dc7d5aa20960735f42cbc767ac8f3885f7a36..9445e6f875b6214d12dd9757f6fd4374ab4d6f8e 100644
--- a/src/Lunr/Gravity/Database/MySQL/Tests/Helpers/MySQLDatabaseAccessObjectTest.php
+++ b/src/Lunr/Gravity/Database/MySQL/Tests/Helpers/MySQLDatabaseAccessObjectTest.php
@@ -73,7 +73,7 @@ abstract class MySQLDatabaseAccessObjectTest extends LunrBaseTest
                              ->disableOriginalConstructor()
                              ->getMock();
 
-        $this->logger = $this->getMock('Psr\Log\LoggerInterface');
+        $this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
 
         $this->db->expects($this->at(0))
                  ->method('get_query_escaper_object')
diff --git a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLAsyncQueryResultTest.php b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLAsyncQueryResultTest.php
index 5e4fe38d50de238754c0cc585df64e33aa33ef3b..154e4d260db5e84adfc1b569d4315d57b9ffc696 100644
--- a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLAsyncQueryResultTest.php
+++ b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLAsyncQueryResultTest.php
@@ -56,7 +56,7 @@ abstract class MySQLAsyncQueryResultTest extends PHPUnit_Framework_TestCase
      */
     public function setUp()
     {
-        $this->mysqli = new MockMySQLiSuccessfulConnection($this->getMock('\mysqli'));
+        $this->mysqli = new MockMySQLiSuccessfulConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->query = 'SELECT * FROM table';
 
diff --git a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionConnectTest.php b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionConnectTest.php
index 66ea29613d028876d1605670474311c22a579d05..1e16c5a99615cf8cdcf408d947c2e2cacc4b501f 100644
--- a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionConnectTest.php
+++ b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionConnectTest.php
@@ -148,7 +148,7 @@ class MySQLConnectionConnectTest extends MySQLConnectionTest
      */
     public function testFailedConnect()
     {
-        $mysqli = new MockMySQLiFailedConnection($this->getMock('\mysqli'));
+        $mysqli = new MockMySQLiFailedConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->set_reflection_property_value('mysqli', $mysqli);
 
@@ -195,9 +195,9 @@ class MySQLConnectionConnectTest extends MySQLConnectionTest
      */
     public function testConnectFailsWhenDriverIsNotMysql()
     {
-        $sub_configuration = $this->getMock('Lunr\Core\Configuration');
+        $sub_configuration = $this->getMockBuilder('Lunr\Core\Configuration')->getMock();
 
-        $configuration = $this->getMock('Lunr\Core\Configuration');
+        $configuration = $this->getMockBuilder('Lunr\Core\Configuration')->getMock();
 
         $map = [[ 'db', $sub_configuration ]];
 
@@ -253,7 +253,7 @@ class MySQLConnectionConnectTest extends MySQLConnectionTest
      */
     public function testDisconnect()
     {
-        $mysqli = new MockMySQLiSuccessfulConnection($this->getMock('\mysqli'));
+        $mysqli = new MockMySQLiSuccessfulConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->set_reflection_property_value('mysqli', $mysqli);
 
@@ -275,7 +275,7 @@ class MySQLConnectionConnectTest extends MySQLConnectionTest
      */
     public function testChangeDatabaseReturnsFalseWhenNotConnected()
     {
-        $mysqli = new MockMySQLiFailedConnection($this->getMock('\mysqli'));
+        $mysqli = new MockMySQLiFailedConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->set_reflection_property_value('mysqli', $mysqli);
 
diff --git a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionEscapeTest.php b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionEscapeTest.php
index 92ac62c23ea89d76866dc22def957fc24b95d0a5..d027ca8043f546fbfd0e33eea384dc17beaad75f 100644
--- a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionEscapeTest.php
+++ b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionEscapeTest.php
@@ -30,7 +30,7 @@ class MySQLConnectionEscapeTest extends MySQLConnectionTest
      */
     public function testEscapeStringReturnsFalseWhenNotConnected()
     {
-        $mysqli = new MockMySQLiFailedConnection($this->getMock('\mysqli'));
+        $mysqli = new MockMySQLiFailedConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->set_reflection_property_value('mysqli', $mysqli);
 
diff --git a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionMasterSlaveTest.php b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionMasterSlaveTest.php
index 906bcdc0bd19b769515083aaca280de5ad6fb5de..72b0ee1e241bb2e07142b60ee2fdff284f3f1dc1 100644
--- a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionMasterSlaveTest.php
+++ b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionMasterSlaveTest.php
@@ -184,7 +184,7 @@ class MySQLConnectionMasterSlaveTest extends MySQLConnectionTest
      */
     public function testSetQosPolicyReturnsFalseOnFailure()
     {
-        $mysqli = new MockMySQLiSuccessfulConnection($this->getMock('\mysqli'));
+        $mysqli = new MockMySQLiSuccessfulConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->set_reflection_property_value('mysqli', $mysqli);
 
diff --git a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionQueryTest.php b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionQueryTest.php
index 23c29ce5efec5736c3b843f37865737cfd0f3550..5112bde3ed7a47503bd26088a7dd7325e79187fc 100644
--- a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionQueryTest.php
+++ b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionQueryTest.php
@@ -30,7 +30,7 @@ class MySQLConnectionQueryTest extends MySQLConnectionTest
      */
     public function testQueryReturnsFailedQueryResultWhenNotConnected()
     {
-        $mysqli = new MockMySQLiFailedConnection($this->getMock('\mysqli'));
+        $mysqli = new MockMySQLiFailedConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->set_reflection_property_value('mysqli', $mysqli);
 
@@ -48,7 +48,7 @@ class MySQLConnectionQueryTest extends MySQLConnectionTest
      */
     public function testQueryReturnsQueryResultWhenConnected()
     {
-        $mysqli = new MockMySQLiSuccessfulConnection($this->getMock('\mysqli'));
+        $mysqli = new MockMySQLiSuccessfulConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->set_reflection_property_value('mysqli', $mysqli);
         $this->set_reflection_property_value('connected', TRUE);
@@ -71,7 +71,7 @@ class MySQLConnectionQueryTest extends MySQLConnectionTest
      */
     public function testQueryPrependsQueryHintIfPresent()
     {
-        $mysqli = new MockMySQLiSuccessfulConnection($this->getMock('\mysqli'));
+        $mysqli = new MockMySQLiSuccessfulConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->set_reflection_property_value('mysqli', $mysqli);
         $this->set_reflection_property_value('connected', TRUE);
@@ -95,7 +95,7 @@ class MySQLConnectionQueryTest extends MySQLConnectionTest
      */
     public function testQueryResetsQueryHint()
     {
-        $mysqli = new MockMySQLiSuccessfulConnection($this->getMock('\mysqli'));
+        $mysqli = new MockMySQLiSuccessfulConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->set_reflection_property_value('mysqli', $mysqli);
         $this->set_reflection_property_value('connected', TRUE);
@@ -120,7 +120,7 @@ class MySQLConnectionQueryTest extends MySQLConnectionTest
      */
     public function testAsyncQueryReturnsFailedQueryResultWhenNotConnected()
     {
-        $mysqli = new MockMySQLiFailedConnection($this->getMock('\mysqli'));
+        $mysqli = new MockMySQLiFailedConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->set_reflection_property_value('mysqli', $mysqli);
 
@@ -138,7 +138,7 @@ class MySQLConnectionQueryTest extends MySQLConnectionTest
      */
     public function testAsyncQueryReturnsQueryResultWhenConnected()
     {
-        $mysqli = new MockMySQLiSuccessfulConnection($this->getMock('\mysqli'));
+        $mysqli = new MockMySQLiSuccessfulConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->set_reflection_property_value('mysqli', $mysqli);
 
@@ -168,7 +168,7 @@ class MySQLConnectionQueryTest extends MySQLConnectionTest
      */
     public function testAsyncQueryPrependsQueryHintIfPresent()
     {
-        $mysqli = new MockMySQLiSuccessfulConnection($this->getMock('\mysqli'));
+        $mysqli = new MockMySQLiSuccessfulConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->set_reflection_property_value('mysqli', $mysqli);
         $this->set_reflection_property_value('connected', TRUE);
@@ -191,7 +191,7 @@ class MySQLConnectionQueryTest extends MySQLConnectionTest
      */
     public function testAsyncQueryResetsQueryHint()
     {
-        $mysqli = new MockMySQLiSuccessfulConnection($this->getMock('\mysqli'));
+        $mysqli = new MockMySQLiSuccessfulConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->set_reflection_property_value('mysqli', $mysqli);
         $this->set_reflection_property_value('connected', TRUE);
diff --git a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionTest.php b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionTest.php
index 6026568428753815555e1ad8b10060b140592995..f715f4945542779281474f9b2cb310bc682cd748 100644
--- a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionTest.php
+++ b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionTest.php
@@ -57,9 +57,9 @@ abstract class MySQLConnectionTest extends LunrBaseTest
      */
     public function emptySetUp()
     {
-        $this->sub_configuration = $this->getMock('Lunr\Core\Configuration');
+        $this->sub_configuration = $this->getMockBuilder('Lunr\Core\Configuration')->getMock();
 
-        $this->configuration = $this->getMock('Lunr\Core\Configuration');
+        $this->configuration = $this->getMockBuilder('Lunr\Core\Configuration')->getMock();
 
         $map = [
             ['db', $this->sub_configuration],
@@ -69,9 +69,9 @@ abstract class MySQLConnectionTest extends LunrBaseTest
                             ->method('offsetGet')
                             ->will($this->returnValueMap($map));
 
-        $this->logger = $this->getMock('Psr\Log\LoggerInterface');
+        $this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
 
-        $this->mysqli = $this->getMock('\mysqli');
+        $this->mysqli = $this->getMockBuilder('\mysqli')->getMock();
 
         $this->class = new MySQLConnection($this->configuration, $this->logger, $this->mysqli);
 
@@ -83,9 +83,9 @@ abstract class MySQLConnectionTest extends LunrBaseTest
      */
     public function setUp()
     {
-        $this->sub_configuration = $this->getMock('Lunr\Core\Configuration');
+        $this->sub_configuration = $this->getMockBuilder('Lunr\Core\Configuration')->getMock();
 
-        $this->configuration = $this->getMock('Lunr\Core\Configuration');
+        $this->configuration = $this->getMockBuilder('Lunr\Core\Configuration')->getMock();
 
         $map = [
             ['db', $this->sub_configuration],
@@ -107,9 +107,9 @@ abstract class MySQLConnectionTest extends LunrBaseTest
                                 ->method('offsetGet')
                                 ->will($this->returnValueMap($map));
 
-        $this->logger = $this->getMock('Psr\Log\LoggerInterface');
+        $this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
 
-        $this->mysqli = $this->getMock('\mysqli');
+        $this->mysqli = $this->getMockBuilder('\mysqli')->getMock();
 
         $this->class = new MySQLConnection($this->configuration, $this->logger, $this->mysqli);
 
diff --git a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionTransactionTest.php b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionTransactionTest.php
index d18792db37025ce7c5dc25871da03cdf36da33fa..1b232f4c078e3a3568bb039c87120b54e25dea43 100644
--- a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionTransactionTest.php
+++ b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLConnectionTransactionTest.php
@@ -51,7 +51,7 @@ class MySQLConnectionTransactionTest extends MySQLConnectionTest
      */
     public function testBeginTransactionDoesNothingWhenNotConnected()
     {
-        $mysqli = new MockMySQLiFailedConnection($this->getMock('\mysqli'));
+        $mysqli = new MockMySQLiFailedConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->set_reflection_property_value('mysqli', $mysqli);
 
@@ -85,7 +85,7 @@ class MySQLConnectionTransactionTest extends MySQLConnectionTest
      */
     public function testCommitDoesNothingWhenNotConnected()
     {
-        $mysqli = new MockMySQLiFailedConnection($this->getMock('\mysqli'));
+        $mysqli = new MockMySQLiFailedConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->set_reflection_property_value('mysqli', $mysqli);
 
@@ -119,7 +119,7 @@ class MySQLConnectionTransactionTest extends MySQLConnectionTest
      */
     public function testRollbackDoesNothingWhenNotConnected()
     {
-        $mysqli = new MockMySQLiFailedConnection($this->getMock('\mysqli'));
+        $mysqli = new MockMySQLiFailedConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->set_reflection_property_value('mysqli', $mysqli);
 
@@ -153,7 +153,7 @@ class MySQLConnectionTransactionTest extends MySQLConnectionTest
      */
     public function testEndTransactionDoesNothingWhenNotConnected()
     {
-        $mysqli = new MockMySQLiFailedConnection($this->getMock('\mysqli'));
+        $mysqli = new MockMySQLiFailedConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->set_reflection_property_value('mysqli', $mysqli);
 
diff --git a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLQueryResultTest.php b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLQueryResultTest.php
index a7c4eef5533240771756e66adfe69547b186faa4..742cd21331e182dad323499c68ed7d0281d24a0f 100644
--- a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLQueryResultTest.php
+++ b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLQueryResultTest.php
@@ -65,7 +65,7 @@ abstract class MySQLQueryResultTest extends PHPUnit_Framework_TestCase
      */
     public function resultSetSetup()
     {
-        $this->mysqli = new MockMySQLiSuccessfulConnection($this->getMock('\mysqli'));
+        $this->mysqli = new MockMySQLiSuccessfulConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->query_result = new MockMySQLiResult($this->getMockBuilder('mysqli_result')
                                                         ->disableOriginalConstructor()
@@ -87,7 +87,7 @@ abstract class MySQLQueryResultTest extends PHPUnit_Framework_TestCase
     {
         $this->query_result = FALSE;
 
-        $this->mysqli = new MockMySQLiFailedConnection($this->getMock('\mysqli'));
+        $this->mysqli = new MockMySQLiFailedConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->query = 'SELECT * FROM table';
 
@@ -105,7 +105,7 @@ abstract class MySQLQueryResultTest extends PHPUnit_Framework_TestCase
     {
         $this->query_result = TRUE;
 
-        $this->mysqli = new MockMySQLiSuccessfulConnection($this->getMock('\mysqli'));
+        $this->mysqli = new MockMySQLiSuccessfulConnection($this->getMockBuilder('\mysqli')->getMock());
 
         $this->query = 'SELECT * FROM table';
 
diff --git a/src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3ConnectionConnectTest.php b/src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3ConnectionConnectTest.php
index 91bdb7f962d875bd30a9476b2842bacadc2b9724..ee75fb021ea81a94185ae18209e3d4781533e160 100644
--- a/src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3ConnectionConnectTest.php
+++ b/src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3ConnectionConnectTest.php
@@ -113,9 +113,9 @@ class SQLite3ConnectionConnectTest extends SQLite3ConnectionTest
      */
     public function testConnectFailsWhenDriverIsNotSQLite3()
     {
-        $sub_configuration = $this->getMock('Lunr\Core\Configuration');
+        $sub_configuration = $this->getMockBuilder('Lunr\Core\Configuration')->getMock();
 
-        $configuration = $this->getMock('Lunr\Core\Configuration');
+        $configuration = $this->getMockBuilder('Lunr\Core\Configuration')->getMock();
 
         $map = array(
             array('db', $sub_configuration),
diff --git a/src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3ConnectionTest.php b/src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3ConnectionTest.php
index 79355bada024e1a93c8ea999981b25aceaa8ba12..3d7bd3b02c4b7ee9ce5bb9d50d94c2b993e9b197 100644
--- a/src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3ConnectionTest.php
+++ b/src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3ConnectionTest.php
@@ -57,9 +57,9 @@ abstract class SQLite3ConnectionTest extends LunrBaseTest
             $this->markTestSkipped('Extension sqlite3 is required.');
         }
 
-        $this->sub_configuration = $this->getMock('Lunr\Core\Configuration');
+        $this->sub_configuration = $this->getMockBuilder('Lunr\Core\Configuration')->getMock();
 
-        $this->configuration = $this->getMock('Lunr\Core\Configuration');
+        $this->configuration = $this->getMockBuilder('Lunr\Core\Configuration')->getMock();
 
         $map = array(
             array('db', $this->sub_configuration),
@@ -69,9 +69,9 @@ abstract class SQLite3ConnectionTest extends LunrBaseTest
                             ->method('offsetGet')
                             ->will($this->returnValueMap($map));
 
-        $this->logger = $this->getMock('Psr\Log\LoggerInterface');
+        $this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
 
-        $this->sqlite3 = $this->getMock('Lunr\Gravity\Database\SQLite3\LunrSQLite3');
+        $this->sqlite3 = $this->getMockBuilder('Lunr\Gravity\Database\SQLite3\LunrSQLite3')->getMock();
 
         $this->class = new SQLite3Connection($this->configuration, $this->logger, $this->sqlite3);
 
@@ -88,9 +88,9 @@ abstract class SQLite3ConnectionTest extends LunrBaseTest
             $this->markTestSkipped('Extension sqlite3 is required.');
         }
 
-        $this->sub_configuration = $this->getMock('Lunr\Core\Configuration');
+        $this->sub_configuration = $this->getMockBuilder('Lunr\Core\Configuration')->getMock();
 
-        $this->configuration = $this->getMock('Lunr\Core\Configuration');
+        $this->configuration = $this->getMockBuilder('Lunr\Core\Configuration')->getMock();
 
         $map = array(
             array('db', $this->sub_configuration),
@@ -114,9 +114,9 @@ abstract class SQLite3ConnectionTest extends LunrBaseTest
                                 ->with($this->equalTo('file'))
                                 ->will($this->returnValue(TRUE));
 
-        $this->logger = $this->getMock('Psr\Log\LoggerInterface');
+        $this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
 
-        $this->sqlite3 = $this->getMock('Lunr\Gravity\Database\SQLite3\LunrSQLite3');
+        $this->sqlite3 = $this->getMockBuilder('Lunr\Gravity\Database\SQLite3\LunrSQLite3')->getMock();
 
         $this->class = new SQLite3Connection($this->configuration, $this->logger, $this->sqlite3);
 
diff --git a/src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3QueryResultTest.php b/src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3QueryResultTest.php
index 4b794202b06cb85aae4d7de5b7d501952fdb0e40..d67357cd9d1b000604d753ad909827348a8f0361 100644
--- a/src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3QueryResultTest.php
+++ b/src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3QueryResultTest.php
@@ -53,7 +53,7 @@ class SQLite3QueryResultTest extends LunrBaseTest
      */
     public function setUpWithResult()
     {
-        $this->sqlite3 = $this->getMock('Lunr\Gravity\Database\SQLite3\LunrSQLite3');
+        $this->sqlite3 = $this->getMockBuilder('Lunr\Gravity\Database\SQLite3\LunrSQLite3')->getMock();
 
         $this->query = 'SELECT * FROM table';
 
@@ -73,7 +73,7 @@ class SQLite3QueryResultTest extends LunrBaseTest
      */
     public function setUpWithNoResult()
     {
-        $this->sqlite3 = $this->getMock('Lunr\Gravity\Database\SQLite3\LunrSQLite3');
+        $this->sqlite3 = $this->getMockBuilder('Lunr\Gravity\Database\SQLite3\LunrSQLite3')->getMock();
 
         $this->query = 'SELECT * FROM table';
 
@@ -96,7 +96,7 @@ class SQLite3QueryResultTest extends LunrBaseTest
      */
     public function setUpWithFailedQuery()
     {
-        $this->sqlite3 = $this->getMock('Lunr\Gravity\Database\SQLite3\LunrSQLite3');
+        $this->sqlite3 = $this->getMockBuilder('Lunr\Gravity\Database\SQLite3\LunrSQLite3')->getMock();
 
         $this->query = 'SELECT * FROM table';
 
@@ -124,4 +124,4 @@ class SQLite3QueryResultTest extends LunrBaseTest
 
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/src/Lunr/Gravity/Database/Tests/DatabaseAccessObjectTest.php b/src/Lunr/Gravity/Database/Tests/DatabaseAccessObjectTest.php
index 64c48d6cf65be530721a6c980dde399d8850c420..f179f0bd2aaeed2739f5feb49780813f50b5a03b 100644
--- a/src/Lunr/Gravity/Database/Tests/DatabaseAccessObjectTest.php
+++ b/src/Lunr/Gravity/Database/Tests/DatabaseAccessObjectTest.php
@@ -64,7 +64,7 @@ abstract class DatabaseAccessObjectTest extends PHPUnit_Framework_TestCase
     {
         $this->pool = NULL;
 
-        $this->logger = $this->getMock('Psr\Log\LoggerInterface');
+        $this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
 
         $this->db = $this->getMockBuilder('Lunr\Gravity\Database\MySQL\MySQLConnection')
                          ->disableOriginalConstructor()
@@ -96,7 +96,7 @@ abstract class DatabaseAccessObjectTest extends PHPUnit_Framework_TestCase
                            ->disableOriginalConstructor()
                            ->getMock();
 
-        $this->logger = $this->getMock('Psr\Log\LoggerInterface');
+        $this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
 
         $this->db = $this->getMockBuilder('Lunr\Gravity\Database\MySQL\MySQLConnection')
                          ->disableOriginalConstructor()
diff --git a/src/Lunr/Gravity/Database/Tests/DatabaseConnectionPoolTest.php b/src/Lunr/Gravity/Database/Tests/DatabaseConnectionPoolTest.php
index 8efb036cf8daf7bdb1dc2917c7eb741c91e57ea7..6f639dcac50bcfd0258e216fa12bf9178a7ab29a 100644
--- a/src/Lunr/Gravity/Database/Tests/DatabaseConnectionPoolTest.php
+++ b/src/Lunr/Gravity/Database/Tests/DatabaseConnectionPoolTest.php
@@ -63,9 +63,9 @@ abstract class DatabaseConnectionPoolTest extends PHPUnit_Framework_TestCase
      */
     public function emptySetup()
     {
-        $this->sub_configuration = $this->getMock('Lunr\Core\Configuration');
+        $this->sub_configuration = $this->getMockBuilder('Lunr\Core\Configuration')->getMock();
 
-        $this->configuration = $this->getMock('Lunr\Core\Configuration');
+        $this->configuration = $this->getMockBuilder('Lunr\Core\Configuration')->getMock();
 
         $map = array(
             array('db', $this->sub_configuration),
@@ -75,7 +75,7 @@ abstract class DatabaseConnectionPoolTest extends PHPUnit_Framework_TestCase
                       ->method('offsetGet')
                       ->will($this->returnValueMap($map));
 
-        $this->logger = $this->getMock('Psr\Log\LoggerInterface');
+        $this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
 
         $this->pool = new DatabaseConnectionPool($this->configuration, $this->logger);
 
@@ -89,9 +89,9 @@ abstract class DatabaseConnectionPoolTest extends PHPUnit_Framework_TestCase
      */
     public function unsupportedSetup()
     {
-        $this->sub_configuration = $this->getMock('Lunr\Core\Configuration');
+        $this->sub_configuration = $this->getMockBuilder('Lunr\Core\Configuration')->getMock();
 
-        $this->configuration = $this->getMock('Lunr\Core\Configuration');
+        $this->configuration = $this->getMockBuilder('Lunr\Core\Configuration')->getMock();
 
         $map = array(
             array('db', $this->sub_configuration),
@@ -113,7 +113,7 @@ abstract class DatabaseConnectionPoolTest extends PHPUnit_Framework_TestCase
                       ->method('offsetGet')
                       ->will($this->returnValueMap($map));
 
-        $this->logger = $this->getMock('Psr\Log\LoggerInterface');
+        $this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
 
         $this->pool = new DatabaseConnectionPool($this->configuration, $this->logger);
 
@@ -127,9 +127,9 @@ abstract class DatabaseConnectionPoolTest extends PHPUnit_Framework_TestCase
      */
     public function supportedSetup()
     {
-        $this->sub_configuration = $this->getMock('Lunr\Core\Configuration');
+        $this->sub_configuration = $this->getMockBuilder('Lunr\Core\Configuration')->getMock();
 
-        $this->configuration = $this->getMock('Lunr\Core\Configuration');
+        $this->configuration = $this->getMockBuilder('Lunr\Core\Configuration')->getMock();
 
         $map = array(
             array('db', $this->sub_configuration),
@@ -151,7 +151,7 @@ abstract class DatabaseConnectionPoolTest extends PHPUnit_Framework_TestCase
                       ->method('offsetGet')
                       ->will($this->returnValueMap($map));
 
-        $this->logger = $this->getMock('Psr\Log\LoggerInterface');
+        $this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
 
         $this->pool = new DatabaseConnectionPool($this->configuration, $this->logger);
 
diff --git a/src/Lunr/Gravity/Database/Tests/DatabaseConnectionTest.php b/src/Lunr/Gravity/Database/Tests/DatabaseConnectionTest.php
index aa29233abfb2022eba6f82baa27d252a01fa890e..3c9a24489ddcf01dcd77546e8fb25ac0d49780ab 100644
--- a/src/Lunr/Gravity/Database/Tests/DatabaseConnectionTest.php
+++ b/src/Lunr/Gravity/Database/Tests/DatabaseConnectionTest.php
@@ -42,9 +42,9 @@ abstract class DatabaseConnectionTest extends LunrBaseTest
      */
     public function setUp()
     {
-        $this->configuration = $this->getMock('Lunr\Core\Configuration');
+        $this->configuration = $this->getMockBuilder('Lunr\Core\Configuration')->getMock();
 
-        $this->logger = $this->getMock('Psr\Log\LoggerInterface');
+        $this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
 
         $this->class = $this->getMockBuilder('Lunr\Gravity\Database\DatabaseConnection')
                             ->setConstructorArgs(array(&$this->configuration, &$this->logger))
diff --git a/src/Lunr/Gravity/Filesystem/Tests/PhysicalFilesystemAccessObjectTest.php b/src/Lunr/Gravity/Filesystem/Tests/PhysicalFilesystemAccessObjectTest.php
index 87117528d9c9d23b1b779589f6b93a80d0139b22..1f061e7c4ee0d0127466df335ec7740b9ca6df45 100644
--- a/src/Lunr/Gravity/Filesystem/Tests/PhysicalFilesystemAccessObjectTest.php
+++ b/src/Lunr/Gravity/Filesystem/Tests/PhysicalFilesystemAccessObjectTest.php
@@ -46,7 +46,7 @@ abstract class PhysicalFilesystemAccessObjectTest extends LunrBaseTest
      */
     public function setUp()
     {
-        $this->logger        = $this->getMock('Psr\Log\LoggerInterface');
+        $this->logger        = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
         $this->class         = new PhysicalFilesystemAccessObject($this->logger);
         $this->reflection    = new ReflectionClass('Lunr\Gravity\Filesystem\PhysicalFilesystemAccessObject');
         $this->find_location = TEST_STATICS . '/Gravity';
