Skip to content
Permalink
Browse files

Fix failing tests.

These tests were failing as integers were not being quoted as strings
which is expected for me at least.
  • Loading branch information...
markstory committed Jul 14, 2014
1 parent 41082b1 commit 1c1503fd4537ed071c15ace5e8d3cbdf31709380
Showing with 8 additions and 8 deletions.
  1. +8 −8 cake/tests/cases/libs/model/datasources/dbo_source.test.php
@@ -2766,35 +2766,35 @@ function testArrayConditionsParsing() {
$this->assertEqual($result, $expected);
$result = $this->testDb->conditions(array('Model.field::integer' => 5));
$expected = " WHERE `Model`.`field::integer` = '5'";
$expected = " WHERE `Model`.`field::integer` = 5";
$this->assertEqual($result, $expected);
$result = $this->testDb->conditions(array('"Model"."field"::integer' => 5));
$expected = " WHERE \"Model\".\"field\"::integer = '5'";
$expected = " WHERE \"Model\".\"field\"::integer = 5";
$this->assertEqual($result, $expected);
$result = $this->testDb->conditions(array('Model.field::integer' => array(5, 50, 500)));
$expected = " WHERE `Model`.`field`::integer IN ('5', '50', '500')";
$expected = " WHERE `Model`.`field`::integer IN (5, 50, 500)";
$this->assertEqual($result, $expected);
$result = $this->testDb->conditions(array('"Model"."field"::integer' => array(5, 50, 500)));
$expected = " WHERE \"Model\".\"field\"::integer IN ('5', '50', '500')";
$expected = " WHERE \"Model\".\"field\"::integer IN (5, 50, 500)";
$this->assertEqual($result, $expected);
$result = $this->testDb->conditions(array('Model.field::integer' => array(5, 50)));
$expected = " WHERE `Model`.`field`::integer IN ('5', '50')";
$expected = " WHERE `Model`.`field`::integer IN (5, 50)";
$this->assertEqual($result, $expected);
$result = $this->testDb->conditions(array('"Model"."field"::integer' => array(5, 50)));
$expected = " WHERE \"Model\".\"field\"::integer IN ('5', '50')";
$expected = " WHERE \"Model\".\"field\"::integer IN (5, 50)";
$this->assertEqual($result, $expected);
$result = $this->testDb->conditions(array('Model.field::integer BETWEEN ? AND ?' => array(5, 50)));
$expected = " WHERE `Model`.`field::integer` BETWEEN '5' AND '50'";
$expected = " WHERE `Model`.`field::integer` BETWEEN 5 AND 50";
$this->assertEqual($result, $expected);
$result = $this->testDb->conditions(array('"Model"."field"::integer BETWEEN ? AND ?' => array(5, 50)));
$expected = " WHERE \"Model\".\"field\"::integer BETWEEN '5' AND '50'";
$expected = " WHERE \"Model\".\"field\"::integer BETWEEN 5 AND 50";
$this->assertEqual($result, $expected);
}

0 comments on commit 1c1503f

Please sign in to comment.
You can’t perform that action at this time.