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:
2024-09-27 02:15:00 +00:00
parent 9e0e663811
commit d067f8983f
66 changed files with 1728 additions and 664 deletions

View File

@@ -25,21 +25,23 @@ class CountTest extends TestCase
parent::tearDown();
}
#[TestDox('all() succeeds')]
public function testAllSucceeds(): void
{
$this->assertEquals('SELECT COUNT(*) FROM a_table', Count::all('a_table'),
'SELECT statement not generated correctly');
}
#[TestDox('byFields() succeeds')]
public function testByFieldsSucceeds(): void
{
Configuration::overrideMode(Mode::SQLite);
$this->assertEquals("SELECT COUNT(*) FROM somewhere WHERE data->>'errors' > :errors",
Count::byFields('somewhere', [Field::GT('errors', 10, ':errors')]),
Count::byFields('somewhere', [Field::greater('errors', 10, ':errors')]),
'SELECT statement not generated correctly');
}
#[TestDox('By contains succeeds for PostgreSQL')]
#[TestDox('byContains() succeeds for PostgreSQL')]
public function testByContainsSucceedsForPostgreSQL(): void
{
Configuration::overrideMode(Mode::PgSQL);
@@ -47,14 +49,14 @@ class CountTest extends TestCase
'SELECT statement not generated correctly');
}
#[TestDox('By contains fails for non PostgreSQL')]
#[TestDox('byContains() fails for non PostgreSQL')]
public function testByContainsFailsForNonPostgreSQL(): void
{
$this->expectException(DocumentException::class);
Count::byContains('');
}
#[TestDox('By JSON Path succeeds for PostgreSQL')]
#[TestDox('byJsonPath() succeeds for PostgreSQL')]
public function testByJsonPathSucceedsForPostgreSQL(): void
{
Configuration::overrideMode(Mode::PgSQL);
@@ -62,7 +64,7 @@ class CountTest extends TestCase
Count::byJsonPath('a_table'), 'SELECT statement 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);