diff --git a/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php b/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php index 5de319547..306d6a071 100644 --- a/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php @@ -197,6 +197,18 @@ class DboSourceTest extends CakeTestCase { $this->assertEquals(' WHERE 1 = 1', $result, 'nested empty conditions failed'); } +/** + * test that PostgreSQL json operators can be used. + * + * @return void + */ + public function testColumnHyphenOperator() { + $result = $this->testDb->conditions(array('Foo.bar->>\'fieldName\'' => 42)); + echo "Result is: "; + echo $result; + $this->assertEquals(' WHERE `Foo`.`bar`->>\'fieldName\' = 42', $result, 'pgsql json operator failed'); + } + /** * test that order() will accept objects made from DboSource::expression *