diff options
author | Joas Schilling <coding@schilljs.com> | 2018-10-19 16:44:28 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2018-11-08 15:44:45 +0100 |
commit | bb352fb667e87ea0829f1da5f9e85c34bdefe9fa (patch) | |
tree | cd243856dcfec5708528418b55269e3d7feed53a /tests | |
parent | 78fd8ab0fd362fd5d568dfc5b47a02158e62d51c (diff) | |
download | nextcloud-server-bb352fb667e87ea0829f1da5f9e85c34bdefe9fa.tar.gz nextcloud-server-bb352fb667e87ea0829f1da5f9e85c34bdefe9fa.zip |
Use the defined func()->count() instead of manual counting
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
5 files changed, 5 insertions, 5 deletions
diff --git a/tests/lib/Authentication/Token/DefaultTokenMapperTest.php b/tests/lib/Authentication/Token/DefaultTokenMapperTest.php index bebceba62cf..a40db4461d2 100644 --- a/tests/lib/Authentication/Token/DefaultTokenMapperTest.php +++ b/tests/lib/Authentication/Token/DefaultTokenMapperTest.php @@ -93,7 +93,7 @@ class DefaultTokenMapperTest extends TestCase { private function getNumberOfTokens() { $qb = $this->dbConnection->getQueryBuilder(); - $result = $qb->select($qb->createFunction('count(*) as `count`')) + $result = $qb->select($qb->func()->count('*', 'count')) ->from('authtoken') ->execute() ->fetch(); diff --git a/tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php b/tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php index 89adef5bb8f..22e1891b51f 100644 --- a/tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php +++ b/tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php @@ -117,7 +117,7 @@ class PublicKeyTokenMapperTest extends TestCase { private function getNumberOfTokens() { $qb = $this->dbConnection->getQueryBuilder(); - $result = $qb->select($qb->createFunction('count(*) as `count`')) + $result = $qb->select($qb->func()->count('*', 'count')) ->from('authtoken') ->execute() ->fetch(); diff --git a/tests/lib/DB/QueryBuilder/ExpressionBuilderTest.php b/tests/lib/DB/QueryBuilder/ExpressionBuilderTest.php index 1bf42d230fe..f5dc2a07246 100644 --- a/tests/lib/DB/QueryBuilder/ExpressionBuilderTest.php +++ b/tests/lib/DB/QueryBuilder/ExpressionBuilderTest.php @@ -400,7 +400,7 @@ class ExpressionBuilderTest extends TestCase { $this->createConfig($appId, 11, 'underscore'); $query = $this->connection->getQueryBuilder(); - $query->select($query->createFunction('COUNT(*) AS `count`')) + $query->select($query->func()->count('*', 'count')) ->from('appconfig') ->where($query->expr()->eq('appid', $query->createNamedParameter($appId))) ->andWhere(call_user_func([$query->expr(), $function], 'configvalue', $query->createNamedParameter($value, $type), IQueryBuilder::PARAM_STR)); diff --git a/tests/lib/Repair/CleanTagsTest.php b/tests/lib/Repair/CleanTagsTest.php index 115bce49f71..58fc6af6efb 100644 --- a/tests/lib/Repair/CleanTagsTest.php +++ b/tests/lib/Repair/CleanTagsTest.php @@ -117,7 +117,7 @@ class CleanTagsTest extends \Test\TestCase { */ protected function assertEntryCount($tableName, $expected, $message = '') { $qb = $this->connection->getQueryBuilder(); - $result = $qb->select($qb->createFunction('COUNT(*)')) + $result = $qb->select($qb->func()->count('*')) ->from($tableName) ->execute(); diff --git a/tests/lib/Repair/RemoveRootSharesTest.php b/tests/lib/Repair/RemoveRootSharesTest.php index cfb81cb1ecc..9a4882bef29 100644 --- a/tests/lib/Repair/RemoveRootSharesTest.php +++ b/tests/lib/Repair/RemoveRootSharesTest.php @@ -180,7 +180,7 @@ class RemoveRootSharesTest extends \Test\TestCase { //Verify $qb = $this->connection->getQueryBuilder(); - $qb->selectAlias($qb->createFunction('COUNT(*)'), 'count') + $qb->select($qb->func()->count('*', 'count')) ->from('share'); $cursor = $qb->execute(); |