Index: trunk/phase3/tests/phpunit/includes/db/DatabaseTest.php |
— | — | @@ -92,30 +92,30 @@ |
93 | 93 | |
94 | 94 | function testMakeNotInList() { |
95 | 95 | $this->assertEquals( |
| 96 | + "field IN ('0','1')", |
96 | 97 | $this->db->makeList( array( |
97 | 98 | 'field' => array( 0, 1 ) |
98 | | - ) ), |
99 | | - "field IN ('0','1')" |
| 99 | + ), LIST_AND ) |
100 | 100 | ); |
101 | 101 | $this->assertEquals( |
| 102 | + "field NOT IN ('0','1')", |
102 | 103 | $this->db->makeList( array( |
103 | 104 | 'field!' => array( 0, 1 ) |
104 | | - ) ), |
105 | | - "field NOT IN ('0','1')" |
| 105 | + ), LIST_AND ) |
106 | 106 | ); |
107 | 107 | |
108 | 108 | // make sure an array with only one value use = or != |
109 | 109 | $this->assertEquals( |
| 110 | + "field = '777'", |
110 | 111 | $this->db->makeList( array( |
111 | 112 | 'field' => array( 777 ) |
112 | | - ) ), |
113 | | - "field = 777" |
| 113 | + ), LIST_AND ) |
114 | 114 | ); |
115 | 115 | $this->assertEquals( |
| 116 | + "field != '888'", |
116 | 117 | $this->db->makeList( array( |
117 | 118 | 'field!' => array( 888 ) |
118 | | - ) ), |
119 | | - "field != 888" |
| 119 | + ), LIST_AND ) |
120 | 120 | ); |
121 | 121 | } |
122 | 122 | } |
Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -1484,7 +1484,7 @@ |
1485 | 1485 | $list .= $field . $operator . $this->addQuotes( $value[0] ); |
1486 | 1486 | } else { |
1487 | 1487 | $operator = $not ? ' NOT IN ' : ' IN '; |
1488 | | - $list .= $field . $operator . " (" . $this->makeList( $value ) . ") "; |
| 1488 | + $list .= $field . $operator . "(" . $this->makeList( $value ) . ")"; |
1489 | 1489 | } |
1490 | 1490 | } elseif ( $value === null ) { |
1491 | 1491 | if ( $mode == LIST_AND || $mode == LIST_OR ) { |