From 867768d172cc6ddad8605507e048e0c058e36ba6 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Wed, 5 Nov 2014 15:49:30 +0100 Subject: set db as member --- tests/integration/bootstrap.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/integration/bootstrap.php b/tests/integration/bootstrap.php index fc4308ca8..a1bcaaa19 100644 --- a/tests/integration/bootstrap.php +++ b/tests/integration/bootstrap.php @@ -8,9 +8,9 @@ class NewsIntegrationTest extends \PHPUnit_Framework_TestCase { protected $userId = 'test'; protected $userPassword = 'test'; + protected $db; protected function setupNewsDatabase($user='test') { - $db = \OC::$server->getDb(); $sql = [ 'DELETE FROM *PREFIX*news_items WHERE feed_id IN ' . '(SELECT id FROM *PREFIX*news_feeds WHERE user_id = ?)', @@ -19,7 +19,7 @@ class NewsIntegrationTest extends \PHPUnit_Framework_TestCase { ]; foreach ($sql as $query) { - $db->prepareQuery($query)->execute($user); + $this->db->prepareQuery($query)->execute($user); } } @@ -39,6 +39,7 @@ class NewsIntegrationTest extends \PHPUnit_Framework_TestCase { protected function setUp($user='test', $password='test') { + $this->db = \OC::$server->getDb(); $this->setupUser($user, $password); $this->setupNewsDatabase($user); } -- cgit v1.2.3