diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-11-12 17:43:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-12 17:43:56 +0100 |
commit | fd8eeccb15e1219a2d18fc421e741c315737c55e (patch) | |
tree | 55b56592cf40ab4fcc605e45a95d13d79806eb91 /tests/lib | |
parent | 9e1ec0cf46055dbf08a139124d292eb38b8aebd2 (diff) | |
parent | bb352fb667e87ea0829f1da5f9e85c34bdefe9fa (diff) | |
download | nextcloud-server-fd8eeccb15e1219a2d18fc421e741c315737c55e.tar.gz nextcloud-server-fd8eeccb15e1219a2d18fc421e741c315737c55e.zip |
Merge pull request #11942 from nextcloud/techdebt/noid/use-count-function
Use the defined func()->count() instead of manual counting
Diffstat (limited to 'tests/lib')
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(); |