Add byContains and byJsonPath throughout
- Change to JSON Path function to work around PDO syntax quirk
This commit is contained in:
@@ -37,7 +37,7 @@ class CountTest extends TestCase
|
||||
public function testByContainsSucceedsForPostgreSQL(): void
|
||||
{
|
||||
Configuration::$mode = Mode::PgSQL;
|
||||
$this->assertEquals("SELECT COUNT(*) FROM the_table WHERE data @> :criteria", Count::byContains('the_table'),
|
||||
$this->assertEquals('SELECT COUNT(*) FROM the_table WHERE data @> :criteria', Count::byContains('the_table'),
|
||||
'SELECT statement not generated correctly');
|
||||
}
|
||||
|
||||
@@ -52,8 +52,8 @@ class CountTest extends TestCase
|
||||
public function testByJsonPathSucceedsForPostgreSQL(): void
|
||||
{
|
||||
Configuration::$mode = Mode::PgSQL;
|
||||
$this->assertEquals("SELECT COUNT(*) FROM a_table WHERE data @? :path::jsonpath", Count::byJsonPath('a_table'),
|
||||
'SELECT statement not generated correctly');
|
||||
$this->assertEquals('SELECT COUNT(*) FROM a_table WHERE jsonb_path_exists(data, :path::jsonpath)',
|
||||
Count::byJsonPath('a_table'), 'SELECT statement not generated correctly');
|
||||
}
|
||||
|
||||
#[TestDox('By JSON Path fails for non PostgreSQL')]
|
||||
|
||||
Reference in New Issue
Block a user