Added test for ticket #2321

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4721 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
mariano.iglesias 2007-03-31 20:49:26 +00:00
parent f8995e0bde
commit 4da63e762f

View file

@ -862,6 +862,10 @@ class DboSourceTest extends UnitTestCase {
$result = $this->db->conditions("lower(Article.title) LIKE 'a%'"); $result = $this->db->conditions("lower(Article.title) LIKE 'a%'");
$expected = " WHERE lower( `Article`.`title`) LIKE 'a%'"; $expected = " WHERE lower( `Article`.`title`) LIKE 'a%'";
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
$result = $this->db->conditions('((MATCH(Video.title) AGAINST(\'My Search*\' IN BOOLEAN MODE) * 2) + (MATCH( Video.description) AGAINST(\'My Search*\' IN BOOLEAN MODE) * 0.4) + (MATCH(Video.tags) AGAINST(\'My Search*\' IN BOOLEAN MODE) * 1.5))');
$expected = ' WHERE ((MATCH( `Video`.`title`) AGAINST(\'My Search*\' IN BOOLEAN MODE) * 2) + (MATCH( `Video`.`description`) AGAINST(\'My Search*\' IN BOOLEAN MODE) * 0.4) + (MATCH( `Video`.`tags`) AGAINST(\'My Search*\' IN BOOLEAN MODE) * 1.5))';
$this->assertEqual($result, $expected);
} }
function testArrayConditionsParsing() { function testArrayConditionsParsing() {