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,7 +24,7 @@ class DeleteTest extends TestCase
|
||||
Configuration::overrideMode(null);
|
||||
}
|
||||
|
||||
#[TestDox('By ID succeeds')]
|
||||
#[TestDox('byId() succeeds')]
|
||||
public function testByIdSucceeds(): void
|
||||
{
|
||||
Configuration::overrideMode(Mode::SQLite);
|
||||
@@ -32,15 +32,17 @@ class DeleteTest extends TestCase
|
||||
'DELETE statement not constructed correctly');
|
||||
}
|
||||
|
||||
#[TestDox('byFields() succeeds')]
|
||||
public function testByFieldsSucceeds(): void
|
||||
{
|
||||
Configuration::overrideMode(Mode::SQLite);
|
||||
$this->assertEquals("DELETE FROM my_table WHERE data->>'value' < :max AND data->>'value' >= :min",
|
||||
Delete::byFields('my_table', [Field::LT('value', 99, ':max'), Field::GE('value', 18, ':min')]),
|
||||
Delete::byFields('my_table',
|
||||
[Field::less('value', 99, ':max'), Field::greaterOrEqual('value', 18, ':min')]),
|
||||
'DELETE statement not constructed correctly');
|
||||
}
|
||||
|
||||
#[TestDox('By contains succeeds for PostgreSQL')]
|
||||
#[TestDox('byContains() succeeds for PostgreSQL')]
|
||||
public function testByContainsSucceedsForPostgreSQL(): void
|
||||
{
|
||||
Configuration::overrideMode(Mode::PgSQL);
|
||||
@@ -48,14 +50,14 @@ class DeleteTest extends TestCase
|
||||
'DELETE statement not constructed correctly');
|
||||
}
|
||||
|
||||
#[TestDox('By contains fails for non PostgreSQL')]
|
||||
#[TestDox('byContains() fails for non PostgreSQL')]
|
||||
public function testByContainsFailsForNonPostgreSQL(): void
|
||||
{
|
||||
$this->expectException(DocumentException::class);
|
||||
Delete::byContains('');
|
||||
}
|
||||
|
||||
#[TestDox('By JSON Path succeeds for PostgreSQL')]
|
||||
#[TestDox('byJsonPath() succeeds for PostgreSQL')]
|
||||
public function testByJsonPathSucceedsForPostgreSQL(): void
|
||||
{
|
||||
Configuration::overrideMode(Mode::PgSQL);
|
||||
@@ -63,7 +65,7 @@ class DeleteTest extends TestCase
|
||||
Delete::byJsonPath('here'), 'DELETE statement not constructed 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