Add test case for trailing hyphen in column name

This commit is contained in:
Eric Jiang 2016-05-21 15:47:09 -07:00
parent 9f9ae8a9fd
commit 11dfe0b40c

View file

@ -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
*