Added subquery argument support to more types of queries.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8565 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ucorina 2011-07-05 19:49:20 +00:00
parent 4b85afd9b3
commit d248d70773
11 changed files with 232 additions and 32 deletions

View file

@ -2,13 +2,13 @@
class DBTest extends PHPUnit_Framework_TestCase {
function _testQuery($xml_file, $argsString, $expected, $methodName){
//echo PHP_EOL . ' ----------------------------------- ' .PHP_EOL;
//echo $xml_file;
//echo PHP_EOL . ' ----------------------------------- ' .PHP_EOL;
echo PHP_EOL . ' ----------------------------------- ' .PHP_EOL;
echo $xml_file;
echo PHP_EOL . ' ----------------------------------- ' .PHP_EOL;
$tester = new QueryTester();
$outputString = $tester->getNewParserOutputString($xml_file, $argsString);
//echo $outputString;
echo $outputString;
$output = eval($outputString);
if(!is_a($output, 'Query')){
@ -18,8 +18,8 @@
$querySql = $db->{$methodName}($output);
// Remove whitespaces, tabs and all
$querySql = Helper::cleanQuery($querySql);
$expected = Helper::cleanQuery($expected);
$querySql = Helper::cleanString($querySql);
$expected = Helper::cleanString($expected);
}
$this->assertEquals($expected, $querySql);
}
@ -37,8 +37,8 @@
$queryArguments = $output->getArguments();
// Remove whitespaces, tabs and all
$querySql = Helper::cleanQuery($querySql);
$expected = Helper::cleanQuery($expected);
$querySql = Helper::cleanString($querySql);
$expected = Helper::cleanString($expected);
}
// Test
@ -51,9 +51,14 @@
$this->assertEquals($expectedArgs[$i], $queryArguments[$i]->getValue());
}
}
function _testCachedOutput($expected, $actual){
$expected = Helper::cleanString($expected);
$actual = Helper::cleanString($actual);
$this->assertEquals($expected, $actual);
}
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
?>