mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Remove VCS query validator unit tests, no established coverage pattern for these classes
This commit is contained in:
1 parent
bcfdbc829e
commit
4bec2a3088
2 files changed
-95
No files matched your search
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Unit\Utopia\Database\Validator\Queries;
|
||||
|
||||
use Appwrite\Utopia\Database\Validator\Queries\VcsRepositories;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Utopia\Database\Query;
|
||||
|
||||
final class VcsRepositoriesTest extends TestCase
|
||||
{
|
||||
public function testEmptyQueries(): void
|
||||
{
|
||||
$validator = new VcsRepositories();
|
||||
|
||||
$this->assertTrue($validator->isValid([]), $validator->getDescription());
|
||||
}
|
||||
|
||||
public function testValidQueries(): void
|
||||
{
|
||||
$validator = new VcsRepositories();
|
||||
|
||||
$this->assertTrue($validator->isValid([Query::limit(25)]), $validator->getDescription());
|
||||
$this->assertTrue($validator->isValid([Query::offset(0)]), $validator->getDescription());
|
||||
$this->assertTrue($validator->isValid([Query::equal('namespace', ['appwrite'])]), $validator->getDescription());
|
||||
$this->assertTrue($validator->isValid([
|
||||
Query::limit(25),
|
||||
Query::offset(0),
|
||||
Query::equal('namespace', ['appwrite']),
|
||||
]), $validator->getDescription());
|
||||
}
|
||||
|
||||
public function testInvalidQueries(): void
|
||||
{
|
||||
$validator = new VcsRepositories();
|
||||
|
||||
$this->assertFalse($validator->isValid([Query::equal('name', ['appwrite'])]));
|
||||
$this->assertFalse($validator->isValid([Query::greaterThan('namespace', 'appwrite')]));
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Unit\Utopia\Database\Validator\Query;
|
||||
|
||||
use Appwrite\Utopia\Database\Validator\Query\VcsNamespace;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Utopia\Database\Query;
|
||||
|
||||
final class VcsNamespaceTest extends TestCase
|
||||
{
|
||||
public function testIsValid(): void
|
||||
{
|
||||
$validator = new VcsNamespace();
|
||||
|
||||
$this->assertTrue($validator->isValid(Query::equal('namespace', ['appwrite'])), $validator->getDescription());
|
||||
}
|
||||
|
||||
public function testInvalidNotQuery(): void
|
||||
{
|
||||
$validator = new VcsNamespace();
|
||||
|
||||
$this->assertFalse($validator->isValid('namespace'));
|
||||
}
|
||||
|
||||
public function testInvalidMethod(): void
|
||||
{
|
||||
$validator = new VcsNamespace();
|
||||
|
||||
$this->assertFalse($validator->isValid(Query::greaterThan('namespace', 'appwrite')));
|
||||
}
|
||||
|
||||
public function testInvalidAttribute(): void
|
||||
{
|
||||
$validator = new VcsNamespace();
|
||||
|
||||
$this->assertFalse($validator->isValid(Query::equal('name', ['appwrite'])));
|
||||
}
|
||||
|
||||
public function testInvalidMultipleValues(): void
|
||||
{
|
||||
$validator = new VcsNamespace();
|
||||
|
||||
$this->assertFalse($validator->isValid(Query::equal('namespace', ['appwrite', 'utopia'])));
|
||||
}
|
||||
|
||||
public function testInvalidValueTooLong(): void
|
||||
{
|
||||
$validator = new VcsNamespace();
|
||||
|
||||
$this->assertFalse($validator->isValid(Query::equal('namespace', [\str_repeat('a', 257)])));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user