mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-16 09:49:54 +09:00
Added unit tests for correlated subqueries - select, from, where.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8556 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
5d1eb1c21e
commit
1353ade0c2
41 changed files with 661 additions and 256 deletions
|
|
@ -1,36 +1,10 @@
|
|||
<?php
|
||||
require(_XE_PATH_ . 'test-phpUnit/config.inc.php');
|
||||
require(_XE_PATH_ . 'test-phpUnit/db/xml_query/mssql/config.mssql.inc.php');
|
||||
require(_XE_PATH_ . 'test-phpUnit/config/config.inc.php');
|
||||
|
||||
class MssqlSelectTest extends PHPUnit_Framework_TestCase {
|
||||
class MssqlSelectTest extends MssqlTest {
|
||||
|
||||
function _test($xml_file, $argsString, $expected, $expectedArgs = NULL){
|
||||
$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 {
|
||||
$db = &DB::getInstance();
|
||||
$querySql = $db->getSelectSql($output);
|
||||
$queryArguments = $output->getArguments();
|
||||
|
||||
// Remove whitespaces, tabs and all
|
||||
$querySql = Helper::cleanQuery($querySql);
|
||||
$expected = Helper::cleanQuery($expected);
|
||||
}
|
||||
|
||||
// Test
|
||||
$this->assertEquals($expected, $querySql);
|
||||
|
||||
// Test query arguments
|
||||
$argCount = count($expectedArgs);
|
||||
for($i = 0; $i < $argCount; $i++){
|
||||
//echo "$i: $expectedArgs[$i] vs $queryArguments[$i]->getValue()";
|
||||
$this->assertEquals($expectedArgs[$i], $queryArguments[$i]->getValue());
|
||||
}
|
||||
$this->_testPreparedQuery($xml_file, $argsString, $expected, 'getSelectSql', $expectedArgs = NULL);
|
||||
}
|
||||
|
||||
function testSelectStar(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue