Skip to content

Commit 99386f4

Browse files
committed
Fix message
1 parent 3e7d976 commit 99386f4

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/Database/Validator/Queries/V2.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,12 @@ public function isValid($value, string $scope = ''): bool
346346

347347
case Query::TYPE_SELECT:
348348
if (empty($query->getAttribute())) {
349-
throw new \Exception('Invalid query: '.\ucfirst($method).' queries attribute is empty');
349+
throw new \Exception('Invalid query: '.\ucfirst(Query::TYPE_SELECT).' queries requires one attribute');
350350
}
351351

352352
$asValidator = new AsValidator($query->getAttribute());
353353
if (! $asValidator->isValid($query->getAs())) {
354-
throw new \Exception('Invalid query: '.\ucfirst($method).' '.$asValidator->getDescription());
354+
throw new \Exception('Invalid query: '.\ucfirst(Query::TYPE_SELECT).' '.$asValidator->getDescription());
355355
}
356356

357357
if ($query->getAttribute() !== '*') {

tests/e2e/Adapter/Scopes/DocumentTests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,7 @@ public function testGetDocumentOnlySelectQueries(Document $document): Document
15161516
]);
15171517
$this->fail('Failed to throw exception');
15181518
} catch (Throwable $e) {
1519-
$this->assertEquals('Invalid query: Select queries attribute is empty', $e->getMessage());
1519+
$this->assertEquals('Invalid query: Select queries requires one attribute', $e->getMessage());
15201520
$this->assertTrue($e instanceof DatabaseException);
15211521
}
15221522

0 commit comments

Comments
 (0)