merge from branch luminous (version 1.5.4.2, ~r12561)

git-svn-id: http://xe-core.googlecode.com/svn/trunk@12611 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2013-01-30 05:53:14 +00:00
parent 2263200ce4
commit cc47d2b247
196 changed files with 3655 additions and 2033 deletions

View file

@ -36,6 +36,7 @@
require_once(_XE_PATH_.'classes/db/queryparts/expression/InsertExpression.class.php');
require_once(_XE_PATH_.'classes/db/queryparts/expression/UpdateExpression.class.php');
require_once(_XE_PATH_.'classes/db/queryparts/expression/UpdateExpressionWithoutArgument.class.php');
require_once(_XE_PATH_.'classes/db/queryparts/expression/ClickCountExpression.class.php');
require_once(_XE_PATH_.'classes/db/queryparts/table/Table.class.php');
require_once(_XE_PATH_.'classes/db/queryparts/table/JoinTable.class.php');
require_once(_XE_PATH_.'classes/db/queryparts/table/CubridTableWithHint.class.php');

View file

@ -20,8 +20,12 @@ class DBTest extends PHPUnit_Framework_TestCase {
$querySql = $db->{$methodName}($output);
// Remove whitespaces, tabs and all
$querySql = Helper::cleanString($querySql);
$expected = Helper::cleanString($expected);
if(is_a($querySql, 'Object'))
{
$querySql = $querySql->getMessage();
}
$querySql = Helper::cleanString($querySql);
$expected = Helper::cleanString($expected);
}
$this->assertEquals($expected, $querySql);
}

View file

@ -439,6 +439,17 @@
$argsString = '$args->package_srl = 18325662;';
$expectedArgs = array(18325662);
$this->_testPreparedQuery($xml_file, $argsString, $expected, 'getSelectSql', $expectedArgs);
}
}
/**
* Issue 1431 - xml click count error
*/
function testClickCount()
{
$xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/click_count.xml";
$argsString = '$args->incr_expose_count = true;';
$expected = 'select INCR("expose_count") from "xe_modules" as "modules"';
$this->_test($xml_file, $argsString, $expected);
}
}

View file

@ -0,0 +1,8 @@
<query id="getNewestDocuments" action="select">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="expose_count" click_count="incr_expose_count"/>
</columns>
</query>

View file

@ -380,4 +380,37 @@ class MysqlSelectTest extends MysqlTest {
limit 5";
$this->_test($xml_file, $argsString, $expected);
}
}
/**
* Add support for CAST / CONVERT function
*/
function testCast()
{
$xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/cast.xml";
$argsString = '';
$expected = "select cast(`document_srl` as unsigned integer) from `xe_documents` as `documents`";
$this->_test($xml_file, $argsString, $expected);
}
/**
* Add support for CAST / CONVERT function
*/
function testConvert()
{
$xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/convert.xml";
$argsString = '';
$expected = "select convert(`document_srl`, unsigned integer) from `xe_documents` as `documents`";
$this->_test($xml_file, $argsString, $expected);
}
/**
* Issue 1431 - xml click count error
*/
function testClickCount()
{
$xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/click_count.xml";
$argsString = '$args->incr_expose_count = true;';
$expected = "select `expose_count` from `xe_modules` as `modules`";
$this->_test($xml_file, $argsString, $expected);
}
}

View file

@ -0,0 +1,8 @@
<query id="getDocumentListWithinComment" action="select">
<tables>
<table name="documents" alias="documents" />
</tables>
<columns>
<column name="CAST(document_srl as UNSIGNED INTEGER)" />
</columns>
</query>

View file

@ -0,0 +1,8 @@
<query id="getNewestDocuments" action="select">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="expose_count" click_count="incr_expose_count"/>
</columns>
</query>

View file

@ -0,0 +1,8 @@
<query id="getDocumentListWithinComment" action="select">
<tables>
<table name="documents" alias="documents" />
</tables>
<columns>
<column name="CONVERT(document_srl, UNSIGNED INTEGER)" />
</columns>
</query>

View file

@ -4,6 +4,7 @@ if(!defined('__XE__')) require dirname(__FILE__).'/../../Bootstrap.php';
require_once _XE_PATH_.'classes/handler/Handler.class.php';
require_once _XE_PATH_.'classes/frontendfile/FrontEndFileHandler.class.php';
require_once _XE_PATH_.'classes/file/FileHandler.class.php';
class FrontEndFileHandlerTest extends PHPUnit_Framework_TestCase
@ -16,12 +17,12 @@ class FrontEndFileHandlerTest extends PHPUnit_Framework_TestCase
$handler = new FrontEndFileHandler();
// js(head)
$handler->loadFile(array('./common/js/jquery.js'));
$handler->loadFile(array('./common/js/jquery.min.js'));
$handler->loadFile(array('./common/js/js_app.js'));
$handler->loadFile(array('./common/js/common.js'));
$handler->loadFile(array('./common/js/xml_handler.js'));
$handler->loadFile(array('./common/js/xml_js_filter.js'));
$expected[] = array('file' => '/xe/common/js/jquery.js', 'targetie' => '');
$expected[] = array('file' => '/xe/common/js/js_app.js', 'targetie' => '');
$expected[] = array('file' => '/xe/common/js/common.js', 'targetie' => '');