Reverted rev 10009 and 10010 related to db classes - will commit changes to 1.6.0 branch.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10012 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ucorina 2012-01-05 12:08:50 +00:00
parent 1f5e256339
commit 00d2fdf2b1
8 changed files with 38 additions and 175 deletions

View file

@ -1,44 +0,0 @@
<?php
/**
* @class MysqlInsertTest
* @brief Constains all test method for insert statements, using Mysql SQL syntax
* @developer Corina Udrescu (xe_dev@arnia.ro)
*/
class MysqlInsertTest extends MysqlTest
{
/**
* @brief _test - local helper method
* @developer Corina Udrescu (xe_dev@arnia.ro)
* @access private
* @param $xml_file string - Path to XML file containing the query to be tested
* @param $argsString string - String containing PHP code that initializez the arguments that the query receives
* @param $expected string - Expected SQL query as string
* @param $columnList array - Array containing the column names that will be retrieved, in case only a part of the ones in the query file are needed
* @return void
*/
function _test($xml_file, $argsString, $expected, $columnList = NULL)
{
$this->_testQuery($xml_file, $argsString, $expected, 'getInsertSql', $columnList);
}
/**
* @brief testInsertSelectStatement - checks that when query action is 'insert-selct' an 'INSERT INTO .. SELECT ...' statement is properly generated
* @developer Corina Udrescu (xe_dev@arnia.ro)
* @access public
* @return void
*/
function testInsertSelectStatement()
{
$xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/insert_select.xml";
$argsString = '$args->condition_value = 7;';
$expected = 'insert into `xe_table1` (`column1`, `column2`, `column3`)
select `column4`, `column5`, `column6`
from `xe_table2` as `table2`
where `column4` >= 7';
$this->_test($xml_file, $argsString, $expected);
}
}
/* End of file MysqlInsertTest.php */
/* Location: ./tests/classes/db/db/xml_query/mysql/MysqlInsertTest.php */

View file

@ -1,23 +0,0 @@
<query id="QUERY_ID" action="insert-select">
<tables>
<table name="table1" />
</tables>
<columns>
<column name="column1" />
<column name="column2" />
<column name="column3" />
</columns>
<query>
<tables>
<table name="table2" />
</tables>
<columns>
<column name="column4" />
<column name="column5" />
<column name="column6" />
</columns>
<conditions>
<condition operation="more" column="column4" default="100" var="condition_value" />
</conditions>
</query>
</query>