Commit dc085028 authored by chris rehfeld's avatar chris rehfeld

remove debug echo statements and use more phpunit built in facilities where available

parent 5ccf6e1e
...@@ -115,19 +115,7 @@ class DoctrineDb2v10AdaptorTest extends PHPUnit_Framework_TestCase { ...@@ -115,19 +115,7 @@ class DoctrineDb2v10AdaptorTest extends PHPUnit_Framework_TestCase {
usort($oldRows, $cmp); usort($oldRows, $cmp);
usort($newRows, $cmp); usort($newRows, $cmp);
// compare the keys and values of row n in the old to row n in the new. $this->assertEquals($newRows, $oldRows);
// this doesn't consider the order of the columns in the row, which shouldn't matter.
foreach ($oldRows as $k => $oldRow) {
$diff = array_diff_assoc($oldRow, $newRows[$k]);
if ($diff) {
var_dump($k, $diff);
print_r($oldRow);
print_r($newRows[$k]);
print_r($oldRows);
print_r($newRows);
}
$this->assertEmpty($diff);
}
} }
private function getAllTables() private function getAllTables()
...@@ -139,12 +127,12 @@ class DoctrineDb2v10AdaptorTest extends PHPUnit_Framework_TestCase { ...@@ -139,12 +127,12 @@ class DoctrineDb2v10AdaptorTest extends PHPUnit_Framework_TestCase {
return array_map(function($row) { return array_map(function($row) {
return $row['TABNAME']; return $row['TABNAME'];
}, $this->fetchAll($sql, [], $this->conn)); }, $this->fetchAll($sql, array(), $this->conn));
} }
private function fetchAll($sql, $args, $conn) private function fetchAll($sql, $args, $conn)
{ {
$ret = []; $ret = array();
$stmt = db2_prepare($conn, $sql); $stmt = db2_prepare($conn, $sql);
db2_execute($stmt, $args); db2_execute($stmt, $args);
while ($row = db2_fetch_assoc($stmt)) { while ($row = db2_fetch_assoc($stmt)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment