Add PostgreSQL Support (#3)
Reviewed-on: #3
This commit was merged in pull request #3.
This commit is contained in:
@@ -9,6 +9,7 @@ use PHPUnit\Framework\TestCase;
|
||||
/**
|
||||
* Unit tests for the Field class
|
||||
*/
|
||||
#[TestDox('Field (Unit tests)')]
|
||||
class FieldTest extends TestCase
|
||||
{
|
||||
#[TestDox('Append parameter succeeds for EX')]
|
||||
@@ -221,7 +222,7 @@ class FieldTest extends TestCase
|
||||
try {
|
||||
$field = Field::LE('le_field', 18, '@it');
|
||||
$field->qualifier = 'q';
|
||||
$this->assertEquals("q.data->>'le_field' <= @it", $field->toWhere(),
|
||||
$this->assertEquals("(q.data->>'le_field')::numeric <= @it", $field->toWhere(),
|
||||
'WHERE fragment not generated correctly');
|
||||
} finally {
|
||||
Configuration::$mode = null;
|
||||
@@ -248,7 +249,7 @@ class FieldTest extends TestCase
|
||||
Configuration::$mode = Mode::PgSQL;
|
||||
try {
|
||||
$field = Field::EQ('sub.foo.bar', 22, '@it');
|
||||
$this->assertEquals("data->>'sub.foo.bar' = @it", $field->toWhere(),
|
||||
$this->assertEquals("(data#>>'{sub,foo,bar}')::numeric = @it", $field->toWhere(),
|
||||
'WHERE fragment not generated correctly');
|
||||
} finally {
|
||||
Configuration::$mode = null;
|
||||
|
||||
Reference in New Issue
Block a user