Skip to content

Commit 94664e5

Browse files
committed
Address
1 parent 1d150c9 commit 94664e5

12 files changed

Lines changed: 30 additions & 25 deletions

File tree

composer.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
convertNoticesToExceptions="true"
88
convertWarningsToExceptions="true"
99
processIsolation="false"
10-
stopOnFailure="true"
10+
stopOnFailure="false"
1111
>
1212
<testsuites>
1313
<testsuite name="unit">

src/Database/Database.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
use Utopia\Database\Validator\IndexDependency as IndexDependencyValidator;
3333
use Utopia\Database\Validator\PartialStructure;
3434
use Utopia\Database\Validator\Permissions;
35-
use Utopia\Database\Validator\Queries\V2 as DocumentsValidator;
35+
use Utopia\Database\Validator\Queries\Queries as DocumentsValidator;
3636
use Utopia\Database\Validator\Spatial;
3737
use Utopia\Database\Validator\Structure;
3838

@@ -8556,7 +8556,7 @@ public function count(string $collection, array $queries = [], ?int $max = null)
85568556

85578557
foreach ($context->getCollections() as $contextCollection) {
85588558
$documentSecurity = $contextCollection->getAttribute('documentSecurity', false);
8559-
$skipAuth = $this->authorization->isValid(new Input(self::PERMISSION_READ, $_collection->getRead()));
8559+
$skipAuth = $this->authorization->isValid(new Input(self::PERMISSION_READ, $contextCollection->getRead()));
85608560

85618561
if (!$skipAuth && !$documentSecurity && $contextCollection->getId() !== self::METADATA) {
85628562
throw new AuthorizationException($this->authorization->getDescription());

src/Database/Validator/Queries/V2.php renamed to src/Database/Validator/Queries/Queries.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
use Utopia\Validator\Integer;
2121
use Utopia\Validator\Text;
2222

23-
class V2 extends Validator
23+
class Queries extends Validator
2424
{
2525
protected string $message = 'Invalid query';
2626

tests/unit/CacheKeyTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,13 @@ public function testDifferentSelectsProduceDifferentCacheKeys(): void
4242
{
4343
$db = $this->createDatabase();
4444

45-
[, , $hashA] = $db->getCacheKeys('col', 'doc1', ['name']);
46-
[, , $hashB] = $db->getCacheKeys('col', 'doc1', ['email']);
45+
[, , $hashA] = $db->getCacheKeys('col', 'doc1', [
46+
Query::select('name'),
47+
]);
48+
49+
[, , $hashB] = $db->getCacheKeys('col', 'doc1', [
50+
Query::select('email'),
51+
]);
4752

4853
$this->assertNotEquals($hashA, $hashB);
4954
}

tests/unit/Validator/DocumentQueriesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Utopia\Database\Helpers\ID;
1010
use Utopia\Database\Query;
1111
use Utopia\Database\QueryContext;
12-
use Utopia\Database\Validator\Queries\V2 as DocumentsValidator;
12+
use Utopia\Database\Validator\Queries\Queries as DocumentsValidator;
1313

1414
class DocumentQueriesTest extends TestCase
1515
{

tests/unit/Validator/DocumentsQueriesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Utopia\Database\Helpers\ID;
1010
use Utopia\Database\Query;
1111
use Utopia\Database\QueryContext;
12-
use Utopia\Database\Validator\Queries\V2 as DocumentsValidator;
12+
use Utopia\Database\Validator\Queries\Queries as DocumentsValidator;
1313

1414
class DocumentsQueriesTest extends TestCase
1515
{

tests/unit/Validator/IndexedQueriesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Utopia\Database\Exception;
99
use Utopia\Database\Query;
1010
use Utopia\Database\QueryContext;
11-
use Utopia\Database\Validator\Queries\V2 as DocumentsValidator;
11+
use Utopia\Database\Validator\Queries\Queries as DocumentsValidator;
1212

1313
class IndexedQueriesTest extends TestCase
1414
{

tests/unit/Validator/Query/FilterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Utopia\Database\Helpers\ID;
99
use Utopia\Database\Query;
1010
use Utopia\Database\QueryContext;
11-
use Utopia\Database\Validator\Queries\V2 as DocumentsValidator;
11+
use Utopia\Database\Validator\Queries\Queries as DocumentsValidator;
1212

1313
class FilterTest extends TestCase
1414
{

tests/unit/Validator/Query/OrderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Utopia\Database\Exception;
99
use Utopia\Database\Query;
1010
use Utopia\Database\QueryContext;
11-
use Utopia\Database\Validator\Queries\V2 as DocumentsValidator;
11+
use Utopia\Database\Validator\Queries\Queries as DocumentsValidator;
1212

1313
class OrderTest extends TestCase
1414
{

0 commit comments

Comments
 (0)