Changes for beta10 (#5)
- Add In/InArray support - Add ORDER BY support for `Find` functions - Update dependencies - Implement fixes identified via static analysis Reviewed-on: #5
This commit was merged in pull request #5.
This commit is contained in:
@@ -24,6 +24,7 @@ class ExistsTest extends TestCase
|
||||
Configuration::overrideMode(null);
|
||||
}
|
||||
|
||||
#[TestDox('query() succeeds')]
|
||||
public function testQuerySucceeds(): void
|
||||
{
|
||||
Configuration::overrideMode(Mode::SQLite);
|
||||
@@ -31,7 +32,7 @@ class ExistsTest extends TestCase
|
||||
'Existence query not generated correctly');
|
||||
}
|
||||
|
||||
#[TestDox('By ID succeeds')]
|
||||
#[TestDox('byId() succeeds')]
|
||||
public function testByIdSucceeds(): void
|
||||
{
|
||||
Configuration::overrideMode(Mode::SQLite);
|
||||
@@ -39,15 +40,16 @@ class ExistsTest extends TestCase
|
||||
'Existence query not generated correctly');
|
||||
}
|
||||
|
||||
#[TestDox('byFields() succeeds')]
|
||||
public function testByFieldsSucceeds(): void
|
||||
{
|
||||
Configuration::overrideMode(Mode::SQLite);
|
||||
$this->assertEquals("SELECT EXISTS (SELECT 1 FROM box WHERE data->>'status' <> :status)",
|
||||
Exists::byFields('box', [Field::NE('status', 'occupied', ':status')]),
|
||||
Exists::byFields('box', [Field::notEqual('status', 'occupied', ':status')]),
|
||||
'Existence query not generated correctly');
|
||||
}
|
||||
|
||||
#[TestDox('By contains succeeds for PostgreSQL')]
|
||||
#[TestDox('byContains() succeeds for PostgreSQL')]
|
||||
public function testByContainsSucceedsForPostgreSQL(): void
|
||||
{
|
||||
Configuration::overrideMode(Mode::PgSQL);
|
||||
@@ -55,14 +57,14 @@ class ExistsTest extends TestCase
|
||||
Exists::byContains('pocket'), 'Existence query not generated correctly');
|
||||
}
|
||||
|
||||
#[TestDox('By contains fails for non PostgreSQL')]
|
||||
#[TestDox('byContains() fails for non PostgreSQL')]
|
||||
public function testByContainsFailsForNonPostgreSQL(): void
|
||||
{
|
||||
$this->expectException(DocumentException::class);
|
||||
Exists::byContains('');
|
||||
}
|
||||
|
||||
#[TestDox('By JSON Path succeeds for PostgreSQL')]
|
||||
#[TestDox('byJsonPath() succeeds for PostgreSQL')]
|
||||
public function testByJsonPathSucceedsForPostgreSQL(): void
|
||||
{
|
||||
Configuration::overrideMode(Mode::PgSQL);
|
||||
@@ -70,7 +72,7 @@ class ExistsTest extends TestCase
|
||||
Exists::byJsonPath('lint'), 'Existence query not generated correctly');
|
||||
}
|
||||
|
||||
#[TestDox('By JSON Path fails for non PostgreSQL')]
|
||||
#[TestDox('byJsonPath() fails for non PostgreSQL')]
|
||||
public function testByJsonPathFailsForNonPostgreSQL(): void
|
||||
{
|
||||
$this->expectException(DocumentException::class);
|
||||
|
||||
Reference in New Issue
Block a user