mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-19 03:09:55 +09:00
add some unit tests for CUBRID
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8456 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
d7cf3cb731
commit
e41c45433e
10 changed files with 814 additions and 9 deletions
38
test-phpUnit/DeleteXmlTest_Cubrid.php
Normal file
38
test-phpUnit/DeleteXmlTest_Cubrid.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
require('config.inc.php');
|
||||
|
||||
class DeleteXmlTest_Cubrid extends PHPUnit_Framework_TestCase {
|
||||
|
||||
function _test($xml_file, $argsString, $expected){
|
||||
$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 = new DBCubrid();
|
||||
$querySql = $db->getDeleteSql($output);
|
||||
|
||||
// Remove whitespaces, tabs and all
|
||||
$querySql = Helper::cleanQuery($querySql);
|
||||
$expected = Helper::cleanQuery($expected);
|
||||
}
|
||||
|
||||
// Test
|
||||
$this->assertEquals($expected, $querySql);
|
||||
}
|
||||
|
||||
function test_module_deleteActionForward(){
|
||||
$xml_file = _XE_PATH_ . "modules/module/queries/deleteActionForward.xml";
|
||||
$argsString = '$args->module = "page";
|
||||
$args->type = "page";
|
||||
$args->act = "tata";';
|
||||
$expected = 'delete from "xe_action_forward" as "action_forward"
|
||||
where "module" = \'page\'
|
||||
and "type" = \'page\'
|
||||
and "act" = \'tata\'';
|
||||
$this->_test($xml_file, $argsString, $expected);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue