diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2017-03-20 14:53:57 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-03-21 08:52:20 +0100 |
commit | 0fb577613317404fe53da8e882e08e469c36821a (patch) | |
tree | f5511f2d1ae69fdb0fa4af5e3541ee46e8f976d3 | |
parent | c92b9ce2c43c1a5d1ff645e922bfa8d8b1e8c0d4 (diff) | |
download | nextcloud-server-0fb577613317404fe53da8e882e08e469c36821a.tar.gz nextcloud-server-0fb577613317404fe53da8e882e08e469c36821a.zip |
Fix NODB tests etc
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-rw-r--r-- | tests/lib/TestCase.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php index 021682ae8e4..23a66f73ec7 100644 --- a/tests/lib/TestCase.php +++ b/tests/lib/TestCase.php @@ -139,7 +139,7 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase { if (is_null(self::$realDatabase)) { self::$realDatabase = \OC::$server->getDatabaseConnection(); } - \OC::$server->registerService('DatabaseConnection', function () { + \OC::$server->registerService(IDBConnection::class, function () { $this->fail('Your test case is not allowed to access the database.'); }); } @@ -158,7 +158,7 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase { // restore database connection if (!$this->IsDatabaseAccessAllowed()) { - \OC::$server->registerService('DatabaseConnection', function () { + \OC::$server->registerService(IDBConnection::class, function () { return self::$realDatabase; }); } @@ -171,7 +171,7 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase { // restore database connection if (!$this->IsDatabaseAccessAllowed()) { - \OC::$server->registerService('DatabaseConnection', function () { + \OC::$server->registerService(IDBConnection::class, function () { return self::$realDatabase; }); } @@ -259,7 +259,7 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase { if (!self::$wasDatabaseAllowed && self::$realDatabase !== null) { // in case an error is thrown in a test, PHPUnit jumps straight to tearDownAfterClass, // so we need the database again - \OC::$server->registerService('DatabaseConnection', function () { + \OC::$server->registerService(IDBConnection::class, function () { return self::$realDatabase; }); } |