* Tests assertions where upside-down (expected <-> value)
* Tests did not use LIST_AND
Follow up r87992
$list .= $field . $operator . $this->addQuotes( $value[0] );
} else {
$operator = $not ? ' NOT IN ' : ' IN ';
- $list .= $field . $operator . " (" . $this->makeList( $value ) . ") ";
+ $list .= $field . $operator . "(" . $this->makeList( $value ) . ")";
}
} elseif ( $value === null ) {
if ( $mode == LIST_AND || $mode == LIST_OR ) {
function testMakeNotInList() {
$this->assertEquals(
+ "field IN ('0','1')",
$this->db->makeList( array(
'field' => array( 0, 1 )
- ) ),
- "field IN ('0','1')"
+ ), LIST_AND )
);
$this->assertEquals(
+ "field NOT IN ('0','1')",
$this->db->makeList( array(
'field!' => array( 0, 1 )
- ) ),
- "field NOT IN ('0','1')"
+ ), LIST_AND )
);
// make sure an array with only one value use = or !=
$this->assertEquals(
+ "field = '777'",
$this->db->makeList( array(
'field' => array( 777 )
- ) ),
- "field = 777"
+ ), LIST_AND )
);
$this->assertEquals(
+ "field != '888'",
$this->db->makeList( array(
'field!' => array( 888 )
- ) ),
- "field != 888"
+ ), LIST_AND )
);
}
}