Fixed a few MSSQL bugs - related to array query arguments and increment columns.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8632 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ucorina 2011-07-25 15:35:43 +00:00
parent 6edd5f03a7
commit b3c75ac4db
15 changed files with 411 additions and 276 deletions

View file

@ -1,16 +1,16 @@
<?php
class DBTest extends PHPUnit_Framework_TestCase {
function _testQuery($xml_file, $argsString, $expected, $methodName, $columnList = null){
echo PHP_EOL . ' ----------------------------------- ' .PHP_EOL;
echo $xml_file;
echo PHP_EOL . ' ----------------------------------- ' .PHP_EOL;
$tester = new QueryTester();
$outputString = $tester->getNewParserOutputString($xml_file, $argsString);
echo $outputString;
$output = eval($outputString);
if(!is_a($output, 'Query')){
if(!$output->toBool()) $querySql = "Date incorecte! Query-ul nu a putut fi executat.";
}else {
@ -23,8 +23,8 @@
$expected = Helper::cleanString($expected);
}
$this->assertEquals($expected, $querySql);
}
}
function _testPreparedQuery($xml_file, $argsString, $expected, $methodName, $expectedArgs = NULL){
$tester = new QueryTester();
$outputString = $tester->getNewParserOutputString($xml_file, $argsString);
@ -34,7 +34,7 @@
if(!$output->toBool()) $querySql = "Date incorecte! Query-ul nu a putut fi executat.";
}else {
$db = &DB::getInstance();
$querySql = $db->{$methodName}($output);
$querySql = $db->{$methodName}($output, false);
$queryArguments = $output->getArguments();
// Remove whitespaces, tabs and all
@ -51,14 +51,14 @@
//echo "$i: $expectedArgs[$i] vs $queryArguments[$i]->getValue()";
$this->assertEquals($expectedArgs[$i], $queryArguments[$i]->getValue());
}
}
}
function _testCachedOutput($expected, $actual){
$expected = Helper::cleanString($expected);
$actual = Helper::cleanString($actual);
$this->assertEquals($expected, $actual);
}
}