Changeset 21481 for branches/version-2_12-dev/test/class/SC_DbConn_Test.php
- Timestamp:
- 2012/02/11 05:48:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/test/class/SC_DbConn_Test.php
r21480 r21481 81 81 function testGetAll() { 82 82 $this->createTestTable(); 83 $result = $this->setTestData(1, "2", "f");84 85 $this->expected = array(array( "id" => "1",86 "column1" => "1",87 "column2" => "2",88 "column3" => "f"));83 $result = $this->setTestData(1, '2', 'f'); 84 85 $this->expected = array(array('id' => '1', 86 'column1' => '1', 87 'column2' => '2', 88 'column3' => 'f')); 89 89 $this->actual = $this->objDbConn->getAll("SELECT * FROM test_table WHERE id = ?", array(1)); 90 90 … … 113 113 function testGetOne() { 114 114 $this->createTestTable(); 115 $this->setTestData(1, "2", "f");116 $this->setTestData(1, "2", "f");117 $this->setTestData(1, "2", "f");115 $this->setTestData(1, '2', 'f'); 116 $this->setTestData(1, '2', 'f'); 117 $this->setTestData(1, '2', 'f'); 118 118 119 119 $this->expected = 3; … … 129 129 function testGetOneIsError() { 130 130 $this->createTestTable(); 131 $this->setTestData(1, "2", "f");132 $this->setTestData(1, "2", "f");133 $this->setTestData(1, "2", "f");131 $this->setTestData(1, '2', 'f'); 132 $this->setTestData(1, '2', 'f'); 133 $this->setTestData(1, '2', 'f'); 134 134 135 135 //$this->expected = new PEAR_Error(); … … 145 145 function testGetRow() { 146 146 $this->createTestTable(); 147 $this->setTestData(1, "1", "f");148 $this->setTestData(2, "2", "f");149 $this->setTestData(3, "3", "f");150 151 $this->expected = array( "column1" => 1, "column2"=> 1);147 $this->setTestData(1, '1', 'f'); 148 $this->setTestData(2, '2', 'f'); 149 $this->setTestData(3, '3', 'f'); 150 151 $this->expected = array('column1' => 1, 'column2' => 1); 152 152 $this->actual = $this->objDbConn->getRow("SELECT column1, column2 FROM test_table WHERE id = ?", array(1)); 153 153 $this->verify(); … … 159 159 function testGetCol() { 160 160 $this->createTestTable(); 161 $this->setTestData(1, "1", "f");162 $this->setTestData(2, "2", "f");163 $this->setTestData(3, "3", "f");161 $this->setTestData(1, '1', 'f'); 162 $this->setTestData(2, '2', 'f'); 163 $this->setTestData(3, '3', 'f'); 164 164 165 165 $this->expected = array(1, 2); 166 $this->actual = $this->objDbConn->getCol("SELECT column1, column2 FROM test_table WHERE id < ?", "column1", array(3));166 $this->actual = $this->objDbConn->getCol("SELECT column1, column2 FROM test_table WHERE id < ?", 'column1', array(3)); 167 167 168 168 $this->verify(); … … 176 176 function testAutoExecuteOfInsert() { 177 177 $this->createTestTable(); 178 $result = $this->setTestData(1, "2", "f");179 180 $this->expected = array(array( "id" => "1",181 "column1" => "1",182 "column2" => "2",183 "column3" => "f"));178 $result = $this->setTestData(1, '2', 'f'); 179 180 $this->expected = array(array('id' => '1', 181 'column1' => '1', 182 'column2' => '2', 183 'column3' => 'f')); 184 184 $this->actual = $this->objDbConn->getAll("SELECT * FROM test_table"); 185 185 … … 194 194 function testAutoExecuteOfUpdate() { 195 195 $this->createTestTable(); 196 $this->setTestData(1, "2", "f");197 198 $data = array( "id" => "1",199 "column1" => "2",200 "column2" => "3",201 "column3" => "t");202 203 $result = $this->objDbConn->autoExecute( "test_table", $data, "id = 1");196 $this->setTestData(1, '2', 'f'); 197 198 $data = array('id' => '1', 199 'column1' => '2', 200 'column2' => '3', 201 'column3' => 't'); 202 203 $result = $this->objDbConn->autoExecute('test_table', $data, "id = 1"); 204 204 205 205 $this->expected = array($data); … … 217 217 $this->createTestTable(); 218 218 $sql = "INSERT INTO test_table VALUES (?, ?, ?, ?)"; 219 $data = array( "1", "1", "1", "f");219 $data = array('1', '1', '1', 'f'); 220 220 221 221 $this->objDbConn->query($sql, $data); 222 222 223 $this->expected = array(array( "id" => "1",224 "column1" => "1",225 "column2" => "1",226 "column3" => "f"));223 $this->expected = array(array('id' => '1', 224 'column1' => '1', 225 'column2' => '1', 226 'column3' => 'f')); 227 227 228 228 $this->actual = $this->objDbConn->getAll("SELECT * FROM test_table"); … … 236 236 function testQuery2() { 237 237 $this->createTestTable(); 238 $this->setTestData(1, "2", "f");238 $this->setTestData(1, '2', 'f'); 239 239 240 240 $sql = "UPDATE test_table SET column1 = ?, column2 = ? WHERE id = ?"; 241 $data = array( "2", "2", "1");241 $data = array('2', '2', '1'); 242 242 243 243 $this->objDbConn->query($sql, $data); 244 244 245 $this->expected = array(array( "id" => "1",246 "column1" => "2",247 "column2" => "2",248 "column3" => "f"));245 $this->expected = array(array('id' => '1', 246 'column1' => '2', 247 'column2' => '2', 248 'column3' => 'f')); 249 249 250 250 $this->actual = $this->objDbConn->getAll("SELECT * FROM test_table");
Note: See TracChangeset
for help on using the changeset viewer.
