summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-07-06 12:34:19 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-07-21 15:25:47 +0200
commitde348180ae257017a9a2af05dac72286bf262bed (patch)
tree3fe07523249ca6a6e91defcff781b86be031b98c /tests
parent1bfb944d515c88f915739c3b920d39d6da200d29 (diff)
downloadnextcloud-server-de348180ae257017a9a2af05dac72286bf262bed.tar.gz
nextcloud-server-de348180ae257017a9a2af05dac72286bf262bed.zip
Use the public interface and our method instead of the doctrine thing
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/repair/cleantags.php14
-rw-r--r--tests/lib/share/share.php28
2 files changed, 21 insertions, 21 deletions
diff --git a/tests/lib/repair/cleantags.php b/tests/lib/repair/cleantags.php
index b455aa870fb..fc9b21d4636 100644
--- a/tests/lib/repair/cleantags.php
+++ b/tests/lib/repair/cleantags.php
@@ -18,7 +18,7 @@ class CleanTags extends \Test\TestCase {
/** @var \OC\RepairStep */
protected $repair;
- /** @var \Doctrine\DBAL\Connection */
+ /** @var \OCP\IDBConnection */
protected $connection;
/** @var int */
@@ -39,7 +39,7 @@ class CleanTags extends \Test\TestCase {
}
protected function cleanUpTables() {
- $qb = $this->connection->createQueryBuilder();
+ $qb = $this->connection->getQueryBuilder();
$qb->delete('`*PREFIX*vcategory`')
->execute();
@@ -83,7 +83,7 @@ class CleanTags extends \Test\TestCase {
* @param string $message
*/
protected function assertEntryCount($tableName, $expected, $message = '') {
- $qb = $this->connection->createQueryBuilder();
+ $qb = $this->connection->getQueryBuilder();
$result = $qb->select('COUNT(*)')
->from('`' . $tableName . '`')
->execute();
@@ -99,7 +99,7 @@ class CleanTags extends \Test\TestCase {
* @return int
*/
protected function addTagCategory($category, $type) {
- $qb = $this->connection->createQueryBuilder();
+ $qb = $this->connection->getQueryBuilder();
$qb->insert('`*PREFIX*vcategory`')
->values([
'`uid`' => $qb->createNamedParameter('TestRepairCleanTags'),
@@ -118,7 +118,7 @@ class CleanTags extends \Test\TestCase {
* @param string $type
*/
protected function addTagEntry($objectId, $category, $type) {
- $qb = $this->connection->createQueryBuilder();
+ $qb = $this->connection->getQueryBuilder();
$qb->insert('`*PREFIX*vcategory_to_object`')
->values([
'`objid`' => $qb->createNamedParameter($objectId, \PDO::PARAM_INT),
@@ -137,7 +137,7 @@ class CleanTags extends \Test\TestCase {
return $this->createdFile;
}
- $qb = $this->connection->createQueryBuilder();
+ $qb = $this->connection->getQueryBuilder();
// We create a new file entry and delete it after the test again
$fileName = $this->getUniqueID('TestRepairCleanTags', 12);
@@ -174,7 +174,7 @@ class CleanTags extends \Test\TestCase {
// FIXME INSTEAD HELP FIXING DOCTRINE
// FIXME https://github.com/owncloud/core/issues/13303
// FIXME ALSO FIX https://github.com/owncloud/core/commit/2dd85ec984c12d3be401518f22c90d2327bec07a
- $qb = $this->connection->createQueryBuilder();
+ $qb = $this->connection->getQueryBuilder();
$result = $qb->select("MAX($idName)")
->from($tableName)
->execute();
diff --git a/tests/lib/share/share.php b/tests/lib/share/share.php
index e225f2a4002..e57dd43f839 100644
--- a/tests/lib/share/share.php
+++ b/tests/lib/share/share.php
@@ -1286,7 +1286,7 @@ class Test_Share extends \Test\TestCase {
->getMock();
// Find the share ID in the db
- $qb = $connection->createQueryBuilder();
+ $qb = $connection->getQueryBuilder();
$qb->select('`id`')
->from('`*PREFIX*share`')
->where('`item_type` = :type')
@@ -1307,7 +1307,7 @@ class Test_Share extends \Test\TestCase {
$this->assertTrue($res);
// Fetch the hash from the database
- $qb = $connection->createQueryBuilder();
+ $qb = $connection->getQueryBuilder();
$qb->select('`share_with`')
->from('`*PREFIX*share`')
->where('`id` = :id')
@@ -1335,10 +1335,10 @@ class Test_Share extends \Test\TestCase {
$userSession->method('getUser')->willReturn($user);
- $ex = $this->getMockBuilder('\Doctrine\DBAL\Query\Expression\ExpressionBuilder')
+ $ex = $this->getMockBuilder('\OC\DB\ExpressionBuilder')
->disableOriginalConstructor()
->getMock();
- $qb = $this->getMockBuilder('\Doctrine\DBAL\Query\QueryBuilder')
+ $qb = $this->getMockBuilder('\OC\DB\QueryBuilder')
->disableOriginalConstructor()
->getMock();
$qb->method('update')->will($this->returnSelf());
@@ -1360,7 +1360,7 @@ class Test_Share extends \Test\TestCase {
$connection = $this->getMockBuilder('\OC\DB\Connection')
->disableOriginalConstructor()
->getMock();
- $connection->method('createQueryBuilder')->willReturn($qb);
+ $connection->method('getQueryBuilder')->willReturn($qb);
$config = $this->getMockBuilder('\OCP\IConfig')
->disableOriginalConstructor()
@@ -1390,10 +1390,10 @@ class Test_Share extends \Test\TestCase {
$userSession->method('getUser')->willReturn($user);
- $ex = $this->getMockBuilder('\Doctrine\DBAL\Query\Expression\ExpressionBuilder')
+ $ex = $this->getMockBuilder('\OC\DB\ExpressionBuilder')
->disableOriginalConstructor()
->getMock();
- $qb = $this->getMockBuilder('\Doctrine\DBAL\Query\QueryBuilder')
+ $qb = $this->getMockBuilder('\OC\DB\QueryBuilder')
->disableOriginalConstructor()
->getMock();
$qb->method('update')->will($this->returnSelf());
@@ -1415,7 +1415,7 @@ class Test_Share extends \Test\TestCase {
$connection = $this->getMockBuilder('\OC\DB\Connection')
->disableOriginalConstructor()
->getMock();
- $connection->method('createQueryBuilder')->willReturn($qb);
+ $connection->method('getQueryBuilder')->willReturn($qb);
$config = $this->getMockBuilder('\OCP\IConfig')
->disableOriginalConstructor()
@@ -1443,10 +1443,10 @@ class Test_Share extends \Test\TestCase {
$userSession->method('getUser')->willReturn($user);
- $ex = $this->getMockBuilder('\Doctrine\DBAL\Query\Expression\ExpressionBuilder')
+ $ex = $this->getMockBuilder('\OC\DB\ExpressionBuilder')
->disableOriginalConstructor()
->getMock();
- $qb = $this->getMockBuilder('\Doctrine\DBAL\Query\QueryBuilder')
+ $qb = $this->getMockBuilder('\OC\DB\QueryBuilder')
->disableOriginalConstructor()
->getMock();
$qb->method('update')->will($this->returnSelf());
@@ -1468,7 +1468,7 @@ class Test_Share extends \Test\TestCase {
$connection = $this->getMockBuilder('\OC\DB\Connection')
->disableOriginalConstructor()
->getMock();
- $connection->method('createQueryBuilder')->willReturn($qb);
+ $connection->method('getQueryBuilder')->willReturn($qb);
$config = $this->getMockBuilder('\OCP\IConfig')
->disableOriginalConstructor()
@@ -1496,10 +1496,10 @@ class Test_Share extends \Test\TestCase {
$userSession->method('getUser')->willReturn($user);
- $ex = $this->getMockBuilder('\Doctrine\DBAL\Query\Expression\ExpressionBuilder')
+ $ex = $this->getMockBuilder('\OC\DB\ExpressionBuilder')
->disableOriginalConstructor()
->getMock();
- $qb = $this->getMockBuilder('\Doctrine\DBAL\Query\QueryBuilder')
+ $qb = $this->getMockBuilder('\OC\DB\QueryBuilder')
->disableOriginalConstructor()
->getMock();
$qb->method('update')->will($this->returnSelf());
@@ -1521,7 +1521,7 @@ class Test_Share extends \Test\TestCase {
$connection = $this->getMockBuilder('\OC\DB\Connection')
->disableOriginalConstructor()
->getMock();
- $connection->method('createQueryBuilder')->willReturn($qb);
+ $connection->method('getQueryBuilder')->willReturn($qb);
$config = $this->getMockBuilder('\OCP\IConfig')
->disableOriginalConstructor()