mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-26 22:02:13 +09:00
Merge branch 'release/1.8.3'
This commit is contained in:
commit
9809ae8b10
57 changed files with 1034 additions and 4338 deletions
18
.gitignore
vendored
18
.gitignore
vendored
|
|
@ -1,8 +1,22 @@
|
|||
config.user.inc.php
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
config.user.inc.php
|
||||
/files/
|
||||
/build/
|
||||
|
||||
codeception.yml
|
||||
/tests/_output/
|
||||
/tests/*.suite.yml
|
||||
|
||||
/node_modules/
|
||||
/bower_components/
|
||||
/vendor/
|
||||
tests/_output/*
|
||||
composer.phar
|
||||
composer.lock
|
||||
|
||||
.idea
|
||||
*.sublime-workspace
|
||||
*.sublime-project
|
||||
.codeintel
|
||||
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ before_script:
|
|||
script:
|
||||
- grunt lint
|
||||
- grunt minify
|
||||
- if [ $(phpenv version-name) != "5.3" ]; then ./vendor/bin/codecept run --env travis;
|
||||
- if [ $(phpenv version-name) != "5.3" ]; then ./vendor/bin/codecept run -d --env travis;
|
||||
fi
|
||||
notifications:
|
||||
slack:
|
||||
secure: V4p13KlqML94RK0KTlHNJwrdwOK1K6n7sfxs6oILCJTqBfGuqN2fCglnxX78QEUwnl8LWrwSdA4AnUVfZqv6N5g7zlDDr2ZU2+a4XVApmEss3/C0g9zsYNlFfkJqChvtMsV29UiBjSfqn/coAVLtY1wbCYJYk3Wc2nmB/3Qti9Y=
|
||||
secure: 0HhwktIb65zfge56E4yMfYj0Xj4GeYIaxvh/Obb13BK1/C8RdWBy6u213N5MQ2UHsxYk8wXXzynaCh4psegi2iPy9dbKmkdAdEQMzYoKE2xYVSqZveeVQm0sqFVXAlzggpgs/j5vtvKYjRkQKtTrz0C+p0uJ0bkLcyWGezWTpGc=
|
||||
|
|
|
|||
|
|
@ -1384,7 +1384,7 @@ class Context
|
|||
{
|
||||
$result[$k] = $v;
|
||||
|
||||
if($do_stripslashes && version_compare(PHP_VERSION, '5.9.0', '<') && get_magic_quotes_gpc())
|
||||
if($do_stripslashes && version_compare(PHP_VERSION, '5.4.0', '<') && get_magic_quotes_gpc())
|
||||
{
|
||||
$result[$k] = stripslashes($result[$k]);
|
||||
}
|
||||
|
|
@ -1417,7 +1417,7 @@ class Context
|
|||
*/
|
||||
function _setUploadedArgument()
|
||||
{
|
||||
if($_SERVER['REQUEST_METHOD'] != 'POST' || !$_FILES || stripos($_SERVER['CONTENT_TYPE'], 'multipart/form-data') === FALSE || stripos($_SERVER['HTTP_CONTENT_TYPE'], 'multipart/form-data') === FALSE)
|
||||
if($_SERVER['REQUEST_METHOD'] != 'POST' || !$_FILES || (stripos($_SERVER['CONTENT_TYPE'], 'multipart/form-data') === FALSE && stripos($_SERVER['HTTP_CONTENT_TYPE'], 'multipart/form-data') === FALSE))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,35 +4,6 @@
|
|||
if(!defined('__XE_LOADED_DB_CLASS__'))
|
||||
{
|
||||
define('__XE_LOADED_DB_CLASS__', 1);
|
||||
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/DBParser.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/QueryParser.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/argument/Argument.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/argument/SortArgument.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/argument/ConditionArgument.class.php');
|
||||
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/expression/Expression.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/expression/SelectExpression.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/expression/InsertExpression.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/expression/UpdateExpression.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/expression/UpdateExpressionWithoutArgument.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/expression/ClickCountExpression.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/table/Table.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/table/JoinTable.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/table/CubridTableWithHint.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/table/MysqlTableWithHint.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/table/MssqlTableWithHint.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/table/IndexHint.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/condition/ConditionGroup.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/condition/Condition.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/condition/ConditionWithArgument.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/condition/ConditionWithoutArgument.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/condition/ConditionSubquery.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/expression/StarExpression.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/order/OrderByColumn.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/limit/Limit.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/Query.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/queryparts/Subquery.class.php');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -622,7 +593,6 @@ class DB
|
|||
// if there is no cache file or is not new, find original xml query file and parse it
|
||||
if($cache_time < filemtime($xml_file) || $cache_time < filemtime(_XE_PATH_ . 'classes/db/DB.class.php') || $cache_time < filemtime(_XE_PATH_ . 'classes/xml/XmlQueryParser.class.php'))
|
||||
{
|
||||
require_once(_XE_PATH_ . 'classes/xml/XmlQueryParser.class.php');
|
||||
$oParser = new XmlQueryParser();
|
||||
$oParser->parse($query_id, $xml_file, $cache_file);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ class DBCubrid extends DB
|
|||
*/
|
||||
function addQuotes($string)
|
||||
{
|
||||
if(version_compare(PHP_VERSION, "5.9.0", "<") &&
|
||||
if(version_compare(PHP_VERSION, "5.4.0", "<") &&
|
||||
get_magic_quotes_gpc())
|
||||
{
|
||||
$string = stripslashes(str_replace("\\", "\\\\", $string));
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class DBMssql extends DB
|
|||
*/
|
||||
function addQuotes($string)
|
||||
{
|
||||
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc())
|
||||
if(version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc())
|
||||
{
|
||||
$string = stripslashes(str_replace("\\", "\\\\", $string));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ class DBMysql extends DB
|
|||
*/
|
||||
function addQuotes($string)
|
||||
{
|
||||
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc())
|
||||
if(version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc())
|
||||
{
|
||||
$string = stripslashes(str_replace("\\", "\\\\", $string));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class DBMysqli extends DBMysql
|
|||
*/
|
||||
function addQuotes($string)
|
||||
{
|
||||
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc())
|
||||
if(version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc())
|
||||
{
|
||||
$string = stripslashes(str_replace("\\", "\\\\", $string));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ class DBMysqli_innodb extends DBMysql
|
|||
*/
|
||||
function addQuotes($string)
|
||||
{
|
||||
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc())
|
||||
if(version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc())
|
||||
{
|
||||
$string = stripslashes(str_replace("\\", "\\\\", $string));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,12 +39,10 @@ class DisplayHandler extends Handler
|
|||
// Extract contents to display by the request method
|
||||
if(Context::get('xeVirtualRequestMethod') == 'xml')
|
||||
{
|
||||
require_once(_XE_PATH_ . "classes/display/VirtualXMLDisplayHandler.php");
|
||||
$handler = new VirtualXMLDisplayHandler();
|
||||
}
|
||||
else if(Context::getRequestMethod() == 'XMLRPC')
|
||||
{
|
||||
require_once(_XE_PATH_ . "classes/display/XMLDisplayHandler.php");
|
||||
$handler = new XMLDisplayHandler();
|
||||
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE)
|
||||
{
|
||||
|
|
@ -53,17 +51,14 @@ class DisplayHandler extends Handler
|
|||
}
|
||||
else if(Context::getRequestMethod() == 'JSON')
|
||||
{
|
||||
require_once(_XE_PATH_ . "classes/display/JSONDisplayHandler.php");
|
||||
$handler = new JSONDisplayHandler();
|
||||
}
|
||||
else if(Context::getRequestMethod() == 'JS_CALLBACK')
|
||||
{
|
||||
require_once(_XE_PATH_ . "classes/display/JSCallbackDisplayHandler.php");
|
||||
$handler = new JSCallbackDisplayHandler();
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once(_XE_PATH_ . "classes/display/HTMLDisplayHandler.php");
|
||||
$handler = new HTMLDisplayHandler();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1044,31 +1044,18 @@ class ModuleHandler extends Handler
|
|||
ModuleHandler::_getModuleFilePath($module, $type, $kind, $class_path, $high_class_file, $class_file, $instance_name);
|
||||
}
|
||||
|
||||
// Get base class name and load the file contains it
|
||||
if(!class_exists($module, false))
|
||||
// Check if the base class and instance class exist
|
||||
if(!class_exists($module, true))
|
||||
{
|
||||
$high_class_file = sprintf('%s%s%s.class.php', _XE_PATH_, $class_path, $module);
|
||||
if(!file_exists($high_class_file))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
require_once($high_class_file);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Get the name of the class file
|
||||
if(!is_readable($class_file))
|
||||
if(!class_exists($instance_name, true))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Create an instance with eval function
|
||||
require_once($class_file);
|
||||
if(!class_exists($instance_name, false))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
$tmp_fn = create_function('', "return new {$instance_name}();");
|
||||
$oModule = $tmp_fn();
|
||||
// Create an instance
|
||||
$oModule = new $instance_name();
|
||||
if(!is_object($oModule))
|
||||
{
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ class TemplateHandler
|
|||
$buff = preg_replace('@<!--//.*?-->@s', '', $buff);
|
||||
|
||||
// replace value of src in img/input/script tag
|
||||
$buff = preg_replace_callback('/<(?:img|input|script)[^<>]*src="(?!https?:\/\/|[\/\{])([^"]+)"/is', array($this, '_replacePath'), $buff);
|
||||
$buff = preg_replace_callback('/<(?:img|input|script)(?:[^<>]*?)(?(?=cond=")(?:cond="[^"]+"[^<>]*)+|)[^<>]* src="(?!(?:https?|file):\/\/|[\/\{])([^"]+)"/is', array($this, '_replacePath'), $buff);
|
||||
|
||||
// replace loop and cond template syntax
|
||||
$buff = $this->_parseInline($buff);
|
||||
|
|
@ -362,6 +362,7 @@ class TemplateHandler
|
|||
$__Context->logged_info = Context::get('logged_info');
|
||||
}
|
||||
|
||||
$level = ob_get_level();
|
||||
ob_start();
|
||||
if(substr($buff, 0, 7) == 'file://')
|
||||
{
|
||||
|
|
@ -395,7 +396,12 @@ class TemplateHandler
|
|||
}
|
||||
}
|
||||
|
||||
return ob_get_clean();
|
||||
$contents = '';
|
||||
while (ob_get_level() - $level > 0) {
|
||||
$contents .= ob_get_contents();
|
||||
ob_end_clean();
|
||||
}
|
||||
return $contents;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,31 +7,6 @@
|
|||
if(!defined('__XE_LOADED_XML_CLASS__'))
|
||||
{
|
||||
define('__XE_LOADED_XML_CLASS__', 1);
|
||||
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/tags/query/QueryTag.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/tags/table/TableTag.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/tags/table/HintTableTag.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/tags/table/TablesTag.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/tags/column/ColumnTag.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/tags/column/SelectColumnTag.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/tags/column/InsertColumnTag.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/tags/column/InsertColumnTagWithoutArgument.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/tags/column/UpdateColumnTag.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/tags/column/SelectColumnsTag.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/tags/column/InsertColumnsTag.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/tags/column/UpdateColumnsTag.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/tags/condition/ConditionTag.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/tags/condition/ConditionsTag.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/tags/condition/JoinConditionsTag.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/tags/condition/ConditionGroupTag.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/tags/group/GroupsTag.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/tags/navigation/NavigationTag.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/tags/navigation/IndexTag.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/tags/navigation/LimitTag.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/queryargument/QueryArgument.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/queryargument/SortQueryArgument.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/queryargument/validator/QueryArgumentValidator.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/xmlquery/queryargument/DefaultValue.class.php');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
11
codeception.dist.yml
Normal file
11
codeception.dist.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
actor: Tester
|
||||
paths:
|
||||
tests: tests
|
||||
log: tests/_output
|
||||
data: tests/_data
|
||||
helpers: tests/_support
|
||||
settings:
|
||||
bootstrap: _bootstrap.php
|
||||
colors: true
|
||||
memory_limit: 1024M
|
||||
error_level: "E_ALL & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED & ~E_NOTICE"
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
actor: Tester
|
||||
paths:
|
||||
tests: tests
|
||||
log: tests/_output
|
||||
data: tests/_data
|
||||
helpers: tests/_support
|
||||
settings:
|
||||
bootstrap: _bootstrap.php
|
||||
colors: true
|
||||
memory_limit: 1024M
|
||||
modules:
|
||||
config:
|
||||
Db:
|
||||
dsn: 'mysql:host=127.0.0.1;dbname=xe_test'
|
||||
user: 'root'
|
||||
password: 'root'
|
||||
populate: false
|
||||
cleanup: false
|
||||
error_level: "E_STRICTE_ALL & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED & ~E_NOTICE"
|
||||
|
|
@ -48,6 +48,9 @@
|
|||
editor_sequence: null,
|
||||
init : function() {
|
||||
},
|
||||
deactivate: function() {
|
||||
console.log(this);
|
||||
},
|
||||
createInstance: function(containerEl, opt) {
|
||||
var self = this;
|
||||
var $container = this.$container = containerEl;
|
||||
|
|
@ -152,9 +155,10 @@
|
|||
});
|
||||
|
||||
$(document).bind('dragover', function (e) {
|
||||
var timeout = window.dropZoneTimeout;
|
||||
var timeout = window.dropZoneTimeout,
|
||||
dropZone = self.settings.dropZone;
|
||||
if (!timeout) {
|
||||
self.settings.dropZone.addClass('in');
|
||||
dropZone.addClass('in');
|
||||
} else {
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
|
|
@ -168,13 +172,13 @@
|
|||
node = node.parentNode;
|
||||
} while (node != null);
|
||||
if (found) {
|
||||
self.settings.dropZone.addClass('hover');
|
||||
dropZone.addClass('hover');
|
||||
} else {
|
||||
self.settings.dropZone.removeClass('hover');
|
||||
dropZone.removeClass('hover');
|
||||
}
|
||||
window.dropZoneTimeout = setTimeout(function () {
|
||||
window.dropZoneTimeout = null;
|
||||
self.settings.dropZone.removeClass('in hover');
|
||||
dropZone.removeClass('in hover');
|
||||
}, 100);
|
||||
});
|
||||
},
|
||||
|
|
@ -315,6 +319,9 @@
|
|||
return u;
|
||||
};
|
||||
|
||||
|
||||
xe.unregisterApp();
|
||||
|
||||
// Shortcut function in XE
|
||||
// xe.createXeUploader = function(browseButton, opts) {
|
||||
// var u = new XeUploader(browseButton, opts);
|
||||
|
|
|
|||
|
|
@ -19,15 +19,15 @@
|
|||
<title>{Context::getBrowserTitle()}</title>
|
||||
<!-- CSS -->
|
||||
<block loop="$css_files=>$key,$css_file">
|
||||
<block cond="$css_file['targetie']"><!--[if {$css_file['targetie']}]></block>
|
||||
<block cond="$css_file['targetie']"><!--[if {$css_file['targetie']}]><block cond="stripos($css_file['targetie'], 'gt') === 0"><!--></block></block>
|
||||
<link rel="stylesheet" href="{$css_file['file']}" media="{$css_file['media']}"|cond="$css_file['media'] != 'all'" />
|
||||
<block cond="$css_file['targetie']"><![endif]--></block>
|
||||
<block cond="$css_file['targetie']"><block cond="stripos($css_file['targetie'], 'gt') === 0"><!--</block><![endif]--></block>
|
||||
</block>
|
||||
<!-- JS -->
|
||||
<block loop="$js_files=>$key,$js_file">
|
||||
<block cond="$js_file['targetie']"><!--[if {$js_file['targetie']}]><block cond="stripos($js_file['targetie'], 'gt') === 0"><!--></block></block>
|
||||
<script src="{$js_file['file']}"></script>
|
||||
<block cond="$js_file['targetie']"><![endif]--></block>
|
||||
<block cond="$js_file['targetie']"><block cond="stripos($js_file['targetie'], 'gt') === 0"><!--</block><![endif]--></block>
|
||||
</block>
|
||||
|
||||
<!-- RSS -->
|
||||
|
|
|
|||
|
|
@ -13,15 +13,15 @@
|
|||
<title>{Context::getBrowserTitle()}</title>
|
||||
<!-- CSS -->
|
||||
<block loop="$css_files=>$key,$css_file">
|
||||
<block cond="$css_file['targetie']"><!--[if {$css_file['targetie']}]></block>
|
||||
<block cond="$css_file['targetie']"><!--[if {$css_file['targetie']}]><block cond="stripos($css_file['targetie'], 'gt') === 0"><!--></block></block>
|
||||
<link rel="stylesheet" href="{$css_file['file']}" media="{$css_file['media']}"|cond="$css_file['media'] != 'all'" />
|
||||
<block cond="$css_file['targetie']"><![endif]--></block>
|
||||
<block cond="$css_file['targetie']"><block cond="stripos($css_file['targetie'], 'gt') === 0"><!--</block><![endif]--></block>
|
||||
</block>
|
||||
<!-- JS -->
|
||||
<block loop="$js_files=>$key,$js_file">
|
||||
<block cond="$js_file['targetie']"><!--[if {$js_file['targetie']}]><block cond="stripos($js_file['targetie'], 'gt') === 0"><!--></block></block>
|
||||
<script src="{$js_file['file']}"></script>
|
||||
<block cond="$js_file['targetie']"><![endif]--></block>
|
||||
<block cond="$js_file['targetie']"><block cond="stripos($js_file['targetie'], 'gt') === 0"><!--</block><![endif]--></block>
|
||||
</block>
|
||||
|
||||
<!--// RSS -->
|
||||
|
|
|
|||
1741
composer.lock
generated
1741
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -29,7 +29,7 @@ define('__ZBXE__', __XE__);
|
|||
/**
|
||||
* Display XE's full version.
|
||||
*/
|
||||
define('__XE_VERSION__', '1.8.2');
|
||||
define('__XE_VERSION__', '1.8.3');
|
||||
define('__XE_VERSION_ALPHA__', (stripos(__XE_VERSION__, 'alpha') !== false));
|
||||
define('__XE_VERSION_BETA__', (stripos(__XE_VERSION__, 'beta') !== false));
|
||||
define('__XE_VERSION_RC__', (stripos(__XE_VERSION__, 'rc') !== false));
|
||||
|
|
@ -287,40 +287,146 @@ if(!defined('__XE_LOADED_CLASS__'))
|
|||
// Require a function-defined-file for simple use
|
||||
require(_XE_PATH_ . 'config/func.inc.php');
|
||||
|
||||
if(__DEBUG__)
|
||||
if(__DEBUG__) {
|
||||
define('__StartTime__', getMicroTime());
|
||||
}
|
||||
|
||||
// include the class files
|
||||
//TODO When _autoload() can be used for PHP5 based applications, it will be removed.
|
||||
if(__DEBUG__)
|
||||
define('__ClassLoadStartTime__', getMicroTime());
|
||||
require(_XE_PATH_ . 'classes/object/Object.class.php');
|
||||
require(_XE_PATH_ . 'classes/extravar/Extravar.class.php');
|
||||
require(_XE_PATH_ . 'classes/handler/Handler.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/XmlParser.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/XmlGenerator.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/XmlJsFilter.class.php');
|
||||
require(_XE_PATH_ . 'classes/xml/XmlLangParser.class.php');
|
||||
require(_XE_PATH_ . 'classes/cache/CacheHandler.class.php');
|
||||
require(_XE_PATH_ . 'classes/context/Context.class.php');
|
||||
require(_XE_PATH_ . 'classes/db/DB.class.php');
|
||||
require(_XE_PATH_ . 'classes/file/FileHandler.class.php');
|
||||
require(_XE_PATH_ . 'classes/widget/WidgetHandler.class.php');
|
||||
require(_XE_PATH_ . 'classes/editor/EditorHandler.class.php');
|
||||
require(_XE_PATH_ . 'classes/module/ModuleObject.class.php');
|
||||
require(_XE_PATH_ . 'classes/module/ModuleHandler.class.php');
|
||||
require(_XE_PATH_ . 'classes/display/DisplayHandler.class.php');
|
||||
require(_XE_PATH_ . 'classes/template/TemplateHandler.class.php');
|
||||
require(_XE_PATH_ . 'classes/mail/Mail.class.php');
|
||||
require(_XE_PATH_ . 'classes/page/PageHandler.class.php');
|
||||
require(_XE_PATH_ . 'classes/mobile/Mobile.class.php');
|
||||
require(_XE_PATH_ . 'classes/validator/Validator.class.php');
|
||||
require(_XE_PATH_ . 'classes/frontendfile/FrontEndFileHandler.class.php');
|
||||
require(_XE_PATH_ . 'classes/security/Password.class.php');
|
||||
require(_XE_PATH_ . 'classes/security/Security.class.php');
|
||||
require(_XE_PATH_ . 'classes/security/IpFilter.class.php');
|
||||
if(__DEBUG__)
|
||||
$GLOBALS['__elapsed_class_load__'] = getMicroTime() - __ClassLoadStartTime__;
|
||||
if(__DEBUG__) {
|
||||
$GLOBALS['__elapsed_class_load__'] = 0;
|
||||
}
|
||||
|
||||
$GLOBALS['__xe_autoload_file_map'] = array_change_key_case(array(
|
||||
'CacheBase' => 'classes/cache/CacheHandler.class.php',
|
||||
'CacheHandler' => 'classes/cache/CacheHandler.class.php',
|
||||
'Context' => 'classes/context/Context.class.php',
|
||||
'DB' => 'classes/db/DB.class.php',
|
||||
'Query' => 'classes/db/queryparts/Query.class.php',
|
||||
'Subquery' => 'classes/db/queryparts/Subquery.class.php',
|
||||
'Condition' => 'classes/db/queryparts/condition/Condition.class.php',
|
||||
'ConditionGroup' => 'classes/db/queryparts/condition/ConditionGroup.class.php',
|
||||
'ConditionSubquery' => 'classes/db/queryparts/condition/ConditionSubquery.class.php',
|
||||
'ConditionWithArgument' => 'classes/db/queryparts/condition/ConditionWithArgument.class.php',
|
||||
'ConditionWithoutArgument' => 'classes/db/queryparts/condition/ConditionWithoutArgument.class.php',
|
||||
'ClickCountExpression' => 'classes/db/queryparts/expression/ClickCountExpression.class.php',
|
||||
'DeleteExpression' => 'classes/db/queryparts/expression/DeleteExpression.class.php',
|
||||
'Expression' => 'classes/db/queryparts/expression/Expression.class.php',
|
||||
'InsertExpression' => 'classes/db/queryparts/expression/InsertExpression.class.php',
|
||||
'SelectExpression' => 'classes/db/queryparts/expression/SelectExpression.class.php',
|
||||
'StarExpression' => 'classes/db/queryparts/expression/StarExpression.class.php',
|
||||
'UpdateExpression' => 'classes/db/queryparts/expression/UpdateExpression.class.php',
|
||||
'UpdateExpressionWithoutArgument' => 'classes/db/queryparts/expression/UpdateExpressionWithoutArgument.class.php',
|
||||
'Limit' => 'classes/db/queryparts/limit/Limit.class.php',
|
||||
'OrderByColumn' => 'classes/db/queryparts/order/OrderByColumn.class.php',
|
||||
'CubridTableWithHint' => 'classes/db/queryparts/table/CubridTableWithHint.class.php',
|
||||
'IndexHint' => 'classes/db/queryparts/table/IndexHint.class.php',
|
||||
'JoinTable' => 'classes/db/queryparts/table/JoinTable.class.php',
|
||||
'MssqlTableWithHint' => 'classes/db/queryparts/table/MssqlTableWithHint.class.php',
|
||||
'MysqlTableWithHint' => 'classes/db/queryparts/table/MysqlTableWithHint.class.php',
|
||||
'Table' => 'classes/db/queryparts/table/Table.class.php',
|
||||
'DisplayHandler' => 'classes/display/DisplayHandler.class.php',
|
||||
'HTMLDisplayHandler' => 'classes/display/HTMLDisplayHandler.php',
|
||||
'JSCallbackDisplayHandler' => 'classes/display/JSCallbackDisplayHandler.php',
|
||||
'JSONDisplayHandler' => 'classes/display/JSONDisplayHandler.php',
|
||||
'VirtualXMLDisplayHandler' => 'classes/display/VirtualXMLDisplayHandler.php',
|
||||
'XMLDisplayHandler' => 'classes/display/XMLDisplayHandler.php',
|
||||
'EditorHandler' => 'classes/editor/EditorHandler.class.php',
|
||||
'ExtraVar' => 'classes/extravar/Extravar.class.php',
|
||||
'ExtraItem' => 'classes/extravar/Extravar.class.php',
|
||||
'FileHandler' => 'classes/file/FileHandler.class.php',
|
||||
'FileObject' => 'classes/file/FileObject.class.php',
|
||||
'FrontEndFileHandler' => 'classes/frontendfile/FrontEndFileHandler.class.php',
|
||||
'Handler' => 'classes/handler/Handler.class.php',
|
||||
'XEHttpRequest' => 'classes/httprequest/XEHttpRequest.class.php',
|
||||
'Mail' => 'classes/mail/Mail.class.php',
|
||||
'Mobile' => 'classes/mobile/Mobile.class.php',
|
||||
'ModuleHandler' => 'classes/module/ModuleHandler.class.php',
|
||||
'ModuleObject' => 'classes/module/ModuleObject.class.php',
|
||||
'Object' => 'classes/object/Object.class.php',
|
||||
'PageHandler' => 'classes/page/PageHandler.class.php',
|
||||
'EmbedFilter' => 'classes/security/EmbedFilter.class.php',
|
||||
'IpFilter' => 'classes/security/IpFilter.class.php',
|
||||
'Password' => 'classes/security/Password.class.php',
|
||||
'Purifier' => 'classes/security/Purifier.class.php',
|
||||
'Security' => 'classes/security/Security.class.php',
|
||||
'UploadFileFilter' => 'classes/security/UploadFileFilter.class.php',
|
||||
'TemplateHandler' => 'classes/template/TemplateHandler.class.php',
|
||||
'Validator' => 'classes/validator/Validator.class.php',
|
||||
'WidgetHandler' => 'classes/widget/WidgetHandler.class.php',
|
||||
'GeneralXmlParser' => 'classes/widget/GeneralXmlParser.class.php',
|
||||
'Xml_Node_' => 'classes/xml/XmlParser.class.php',
|
||||
'XmlGenerator' => 'classes/xml/XmlGenerator.class.php',
|
||||
'XmlJsFilter' => 'classes/xml/XmlJsFilter.class.php',
|
||||
'XmlLangParser' => 'classes/xml/XmlLangParser.class.php',
|
||||
'XmlParser' => 'classes/xml/XmlParser.class.php',
|
||||
'XmlQueryParser' => 'classes/xml/XmlQueryParser.class.php',
|
||||
'DBParser' => 'classes/xml/xmlquery/DBParser.class.php',
|
||||
'QueryParser' => 'classes/xml/xmlquery/QueryParser.class.php',
|
||||
'Argument' => 'classes/xml/xmlquery/argument/Argument.class.php',
|
||||
'ConditionArgument' => 'classes/xml/xmlquery/argument/ConditionArgument.class.php',
|
||||
'SortArgument' => 'classes/xml/xmlquery/argument/SortArgument.class.php',
|
||||
'DefaultValue' => 'classes/xml/xmlquery/queryargument/DefaultValue.class.php',
|
||||
'QueryArgument' => 'classes/xml/xmlquery/queryargument/QueryArgument.class.php',
|
||||
'SortQueryArgument' => 'classes/xml/xmlquery/queryargument/SortQueryArgument.class.php',
|
||||
'QueryArgumentValidator' => 'classes/xml/xmlquery/queryargument/validator/QueryArgumentValidator.class.php',
|
||||
'ColumnTag' => 'classes/xml/xmlquery/tags/column/ColumnTag.class.php',
|
||||
'InsertColumnTag' => 'classes/xml/xmlquery/tags/column/InsertColumnTag.class.php',
|
||||
'InsertColumnTagWithoutArgument' => 'classes/xml/xmlquery/tags/column/InsertColumnTagWithoutArgument.class.php',
|
||||
'InsertColumnsTag' => 'classes/xml/xmlquery/tags/column/InsertColumnsTag.class.php',
|
||||
'SelectColumnTag' => 'classes/xml/xmlquery/tags/column/SelectColumnTag.class.php',
|
||||
'SelectColumnsTag' => 'classes/xml/xmlquery/tags/column/SelectColumnsTag.class.php',
|
||||
'UpdateColumnTag' => 'classes/xml/xmlquery/tags/column/UpdateColumnTag.class.php',
|
||||
'UpdateColumnsTag' => 'classes/xml/xmlquery/tags/column/UpdateColumnsTag.class.php',
|
||||
'ConditionGroupTag' => 'classes/xml/xmlquery/tags/condition/ConditionGroupTag.class.php',
|
||||
'ConditionTag' => 'classes/xml/xmlquery/tags/condition/ConditionTag.class.php',
|
||||
'ConditionsTag' => 'classes/xml/xmlquery/tags/condition/ConditionsTag.class.php',
|
||||
'JoinConditionsTag' => 'classes/xml/xmlquery/tags/condition/JoinConditionsTag.class.php',
|
||||
'GroupsTag' => 'classes/xml/xmlquery/tags/group/GroupsTag.class.php',
|
||||
'IndexTag' => 'classes/xml/xmlquery/tags/navigation/IndexTag.class.php',
|
||||
'LimitTag' => 'classes/xml/xmlquery/tags/navigation/LimitTag.class.php',
|
||||
'NavigationTag' => 'classes/xml/xmlquery/tags/navigation/NavigationTag.class.php',
|
||||
'QueryTag' => 'classes/xml/xmlquery/tags/query/QueryTag.class.php',
|
||||
'HintTableTag' => 'classes/xml/xmlquery/tags/table/HintTableTag.class.php',
|
||||
'TableTag' => 'classes/xml/xmlquery/tags/table/TableTag.class.php',
|
||||
'TablesTag' => 'classes/xml/xmlquery/tags/table/TablesTag.class.php',
|
||||
), CASE_LOWER);
|
||||
|
||||
function __xe_autoload($class_name)
|
||||
{
|
||||
if(__DEBUG__) {
|
||||
$time_at = getMicroTime();
|
||||
}
|
||||
|
||||
if(isset($GLOBALS['__xe_autoload_file_map'][strtolower($class_name)]))
|
||||
{
|
||||
require _XE_PATH_ . $GLOBALS['__xe_autoload_file_map'][strtolower($class_name)];
|
||||
}
|
||||
elseif(preg_match('/^([a-zA-Z0-9_]+?)(Admin)?(View|Controller|Model|Api|Wap|Mobile)?$/', $class_name, $matches))
|
||||
{
|
||||
$candidate_filename = array();
|
||||
$candidate_filename[] = 'modules/' . $matches[1] . '/' . $matches[1];
|
||||
if(isset($matches[2]) && $matches[2]) $candidate_filename[] = 'admin';
|
||||
$candidate_filename[] = (isset($matches[3]) && $matches[3]) ? strtolower($matches[3]) : 'class';
|
||||
$candidate_filename[] = 'php';
|
||||
|
||||
$candidate_filename = implode('.', $candidate_filename);
|
||||
|
||||
if(file_exists(_XE_PATH_ . $candidate_filename))
|
||||
{
|
||||
require _XE_PATH_ . $candidate_filename;
|
||||
}
|
||||
}
|
||||
|
||||
if(__DEBUG__) {
|
||||
$GLOBALS['__elapsed_class_load__'] += getMicroTime() - $time_at;
|
||||
}
|
||||
}
|
||||
spl_autoload_register('__xe_autoload');
|
||||
|
||||
if(file_exists(_XE_PATH_ . '/vendor/autoload.php')) {
|
||||
require _XE_PATH_ . '/vendor/autoload.php';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/* End of file config.inc.php */
|
||||
/* Location: ./config/config.inc.php */
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
{@ $sub_header_title = $module_info->browser_title}
|
||||
|
||||
<!--// 초기화 -->
|
||||
{@ $_enable_slide = true}
|
||||
{@ $_enable_slide = false}
|
||||
{@ $_enable_unb = false}
|
||||
{@ $_sample_slide = false}
|
||||
{@ $_sample_footer = false}
|
||||
|
|
@ -29,9 +29,13 @@
|
|||
<block cond="!$layout_info->use_slide">{@ $layout_info->use_slide = 'Y'}</block>
|
||||
<block cond="!$layout_info->enable_intergration_search">{@ $layout_info->enable_intergration_search = 'Y'}</block>
|
||||
|
||||
<block cond="$layout_info->use_slide === 'Y'">
|
||||
{@ $_enable_slide = true}
|
||||
</block>
|
||||
<block cond="$layout_info->use_demo === 'Y'">
|
||||
{@ $_sample_slide = true}
|
||||
<block cond="$_is_indexmodule">{@ $layout_info->use_slide = 'Y'}</block>
|
||||
{@ $_enable_slide = false}
|
||||
<block cond="$_is_indexmodule">{@ $_enable_slide = true}</block>
|
||||
</block>
|
||||
<block cond="!$layout_info->slide_img1">{@ $_sample_slide = true}</block>
|
||||
<block cond="$layout_info->use_demo === 'Y'">{@ $_sample_footer = true}</block>
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@
|
|||
<div class="x_control-group">
|
||||
<label for="" class="x_control-label">{$lang->poll_stop_date}</label>
|
||||
<div class="x_controls">
|
||||
<input type="hidden" name="stop_date" id="stop_date" value="{date('Ymd',time()+60*60*24*30)}" />
|
||||
<input type="date" class="inputDate" value="{date('Y-m-d',time()+60*60*24*30)}" />
|
||||
<input type="hidden" name="stop_date" id="stop_date" value="{date('Ymd',time()+60*60*24*7)}" />
|
||||
<input type="date" class="inputDate" value="{date('Y-m-d',time()+60*60*24*7)}" />
|
||||
<script>
|
||||
(function($){
|
||||
$(function(){
|
||||
|
|
@ -31,7 +31,7 @@ $(function(){
|
|||
, onSelect:function(){
|
||||
$(this).prev('input[type="hidden"]').val(this.value.replace(/-/g,""));
|
||||
}
|
||||
,minDate: new Date("{date('Y-m-d',time()+60*60*24*30)}")
|
||||
,minDate: new Date("{date('Y-m-d',time())}")
|
||||
};
|
||||
$.extend(option,$.datepicker.regional['{$lang_type}']);
|
||||
$(".inputDate").datepicker(option);
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ class installController extends install
|
|||
{
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('');
|
||||
header('location:'.$returnUrl);
|
||||
return;
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ class integration_searchView extends integration_search
|
|||
{
|
||||
$oFile = getClass('file');
|
||||
$oModuleModel = getModel('module');
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
// Check permissions
|
||||
if(!$this->grant->access) return new Object(-1,'msg_not_permitted');
|
||||
|
||||
|
|
@ -72,6 +74,19 @@ class integration_searchView extends integration_search
|
|||
else
|
||||
$module_srl_list = explode(',',$config->target_module_srl);
|
||||
|
||||
// https://github.com/xpressengine/xe-core/issues/1522
|
||||
// 검색 대상을 지정하지 않았을 때 검색 제한
|
||||
if($target === 'include' && !count($module_srl_list))
|
||||
{
|
||||
$oMessageObject = ModuleHandler::getModuleInstance('message');
|
||||
$oMessageObject->setError(-1);
|
||||
$oMessageObject->setMessage('msg_not_enabled');
|
||||
$oMessageObject->dispMessage();
|
||||
$this->setTemplatePath($oMessageObject->getTemplatePath());
|
||||
$this->setTemplateFile($oMessageObject->getTemplateFile());
|
||||
return;
|
||||
}
|
||||
|
||||
// Set a variable for search keyword
|
||||
$is_keyword = Context::get('is_keyword');
|
||||
// Set page variables
|
||||
|
|
|
|||
|
|
@ -68,6 +68,12 @@
|
|||
<value xml:lang="zh-TW"><![CDATA[按"繼續尋找"按鈕繼續搜尋。]]></value>
|
||||
<value xml:lang="ru"><![CDATA['Искать дальше' Если выберете эту кнопку, то продолжится поиск]]></value>
|
||||
</item>
|
||||
<item name="msg_not_enabled">
|
||||
<value xml:lang="ko"><![CDATA[통합 검색을 사용할 수 없습니다.]]></value>
|
||||
</item>
|
||||
<item name="msg_admin_not_enabled">
|
||||
<value xml:lang="ko"><![CDATA[통합 검색을 사용할 수 없습니다. 통합검색 설정에서 대상 모듈을 선택하세요.]]></value>
|
||||
</item>
|
||||
<item name="is_result_text">
|
||||
<value xml:lang="ko"><![CDATA[<strong>'%s'</strong>에 대한 검색결과 <strong>%d</strong>건]]></value>
|
||||
<value xml:lang="en"><![CDATA[There are <strong>%d</strong> result(s) for <strong>'%s'</strong>]]></value>
|
||||
|
|
@ -264,4 +270,4 @@
|
|||
<value xml:lang="vi"><![CDATA[Bình chọn]]></value>
|
||||
</item>
|
||||
</item>
|
||||
</lang>
|
||||
</lang>
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
<select class="modulelist_selected" size="8" multiple="multiple" style="display:block;vertical-align:top;margin:5px 0"></select>
|
||||
<a href="#" id="__module_srl_list_target_module_srl" class="x_btn moduleTrigger" data-multiple="true" style="margin:0 -5px 0 0;border-radius:2px 0 0 0px">{$lang->cmd_add}</a>
|
||||
<button type="button" class="x_btn modulelist_del" style="border-radius:0 2px 2px 0">{$lang->cmd_delete}</button>
|
||||
<p class="x_help-block"><strong>{$lang->about_target_module}</strong></p>
|
||||
<script>
|
||||
xe.registerApp(new xe.ModuleListManager('target_module_srl'));
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -343,6 +343,9 @@ class memberView extends member
|
|||
$oDocumentAdminView = getAdminView('document');
|
||||
$oDocumentAdminView->dispDocumentAdminList();
|
||||
|
||||
$oSecurity = new Security();
|
||||
$oSecurity->encodeHTML('document_list...title', 'search_target', 'search_keyword');
|
||||
|
||||
Context::set('module_srl', $module_srl);
|
||||
$this->setTemplateFile('document_list');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -685,7 +685,7 @@ class moduleAdminController extends module
|
|||
$args->value = trim(Context::get($key));
|
||||
|
||||
// if request method is json, strip slashes
|
||||
if(Context::getRequestMethod() == 'JSON' && version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc())
|
||||
if(Context::getRequestMethod() == 'JSON' && version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc())
|
||||
{
|
||||
$args->value = stripslashes($args->value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -944,7 +944,7 @@ class moduleModel extends module
|
|||
$info->action->{$name} = new stdClass();
|
||||
$info->action->{$name}->type = $type;
|
||||
$info->action->{$name}->grant = $grant;
|
||||
$info->action->{$name}->standalone = ($standalone == 'true') ? TRUE : FALSE;
|
||||
$info->action->{$name}->standalone = $standalone;
|
||||
$info->action->{$name}->ruleset = $ruleset;
|
||||
$info->action->{$name}->method = $method;
|
||||
if($action->attrs->menu_name)
|
||||
|
|
|
|||
|
|
@ -179,6 +179,7 @@ class pageView extends page
|
|||
$filepath = preg_replace('/'.$filename."$/i","",$cache_file);
|
||||
$cache_file = FileHandler::getRealPath($cache_file);
|
||||
|
||||
$level = ob_get_level();
|
||||
// Verify cache
|
||||
if($caching_interval <1 || !file_exists($cache_file) || filemtime($cache_file) + $caching_interval*60 <= $_SERVER['REQUEST_TIME'] || filemtime($cache_file)<filemtime($target_file))
|
||||
{
|
||||
|
|
@ -208,9 +209,13 @@ class pageView extends page
|
|||
|
||||
ob_start();
|
||||
include($cache_file);
|
||||
$content = ob_get_clean();
|
||||
|
||||
return $content;
|
||||
$contents = '';
|
||||
while (ob_get_level() - $level > 0) {
|
||||
$contents .= ob_get_contents();
|
||||
ob_end_clean();
|
||||
}
|
||||
return $contents;
|
||||
}
|
||||
|
||||
function _replacePath($matches)
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ var no_text_comment = '{$lang->no_text_comment}';
|
|||
</thead>
|
||||
<tbody>
|
||||
<tr loop="$trash_list => $no, $oTrashVO">
|
||||
{debugPrint($oTrashVO->unserializedObject)}
|
||||
<td class="nowr"><!--@if($oTrashVO->getOriginModule() == 'document')-->{$lang->document}<!--@else-->{$lang->comment}<!--@end--></td>
|
||||
<td class="title">
|
||||
<strong cond="!trim($oTrashVO->getTitle()) && $oTrashVO->getOriginModule() == 'comment'">{$lang->no_text_comment}</strong>
|
||||
|
|
|
|||
28
tests/Install.suite.dist.yml
Normal file
28
tests/Install.suite.dist.yml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
class_name: InstallTester
|
||||
modules:
|
||||
enabled: [Db, PhpBrowser, DbDropTablesHelper, InstallHelper, Filesystem]
|
||||
config:
|
||||
PhpBrowser:
|
||||
url: 'http://localhost:8000/'
|
||||
DbDropTablesHelper:
|
||||
dsn: 'mysql:host=127.0.0.1;dbname=xe_test'
|
||||
user: 'root'
|
||||
password: 'root'
|
||||
Db:
|
||||
dsn: 'mysql:host=127.0.0.1;dbname=xe_test'
|
||||
user: 'root'
|
||||
password: 'root'
|
||||
cleanup: true
|
||||
env:
|
||||
travis:
|
||||
modules:
|
||||
config:
|
||||
Db:
|
||||
dsn: 'mysql:host=127.0.0.1;dbname=xe_test'
|
||||
user: 'travis'
|
||||
password: 'travis'
|
||||
cleanup: true
|
||||
DbDropTablesHelper:
|
||||
dsn: 'mysql:host=127.0.0.1;dbname=xe_test'
|
||||
user: 'travis'
|
||||
password: 'travis'
|
||||
63
tests/Install/AutoinstallCept.php
Normal file
63
tests/Install/AutoinstallCept.php
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
<?php
|
||||
use \Codeception\Configuration;
|
||||
|
||||
$I = new InstallTester($scenario);
|
||||
|
||||
$config = (!$this->env) ? Configuration::suiteSettings('Install', Configuration::config()) : Configuration::suiteEnvironments('Install')[$this->env];
|
||||
|
||||
$db_config = $config['modules']['config']['Db'];
|
||||
|
||||
$dsn = $db_config['dsn'];
|
||||
$dsn = split('[;:]', $dsn);
|
||||
$db_type = array_shift($dsn);
|
||||
$dbinfo = [
|
||||
'type' => $db_type,
|
||||
'user' => $db_config['user'],
|
||||
'password' => $db_config['password'],
|
||||
'port' => ((isset($db_config['port']) && $db_config['port'])?: 3306),
|
||||
];
|
||||
foreach($dsn as $piece) {
|
||||
list($key, $val) = explode('=', $piece);
|
||||
$dbinfo[$key] = $val;
|
||||
}
|
||||
|
||||
$install_config = array(
|
||||
'db_type' => $dbinfo['type'],
|
||||
'db_port' => $dbinfo['port'],
|
||||
'db_hostname' => $dbinfo['host'],
|
||||
'db_userid' => $dbinfo['user'],
|
||||
'db_password' => $dbinfo['password'],
|
||||
'db_database' => $dbinfo['dbname'],
|
||||
'db_table_prefix' =>'xe_',
|
||||
'use_rewrite' =>'N',
|
||||
'time_zone' =>'0900',
|
||||
'email_address' =>'admin@admin.net',
|
||||
'password' =>'admin',
|
||||
'password2' =>'admin',
|
||||
'nick_name' =>'admin',
|
||||
'user_id' =>'admin',
|
||||
'lang_type' => 'ko',
|
||||
);
|
||||
|
||||
$install_config = '<' . '?php $install_config = ' . var_export($install_config, true) . ';';
|
||||
|
||||
$I->wantTo('Auto install');
|
||||
$I->writeToFile(_XE_PATH_ . 'config/install.config.php', $install_config);
|
||||
$I->amOnPage('/');
|
||||
|
||||
$I->dontSeeElement('//div[@id="progress"]/ul/li');
|
||||
$I->amOnPage('/index.php?act=dispMemberLoginForm');
|
||||
|
||||
$I->fillField('user_id', 'admin@admin.net');
|
||||
$I->submitForm('.login-body form', [
|
||||
'act' => 'procMemberLogin',
|
||||
'user_id' => 'admin@admin.net',
|
||||
'password' => 'admin',
|
||||
'success_return_url' => '/index.php?module=admin'
|
||||
]);
|
||||
|
||||
$I->seeInCurrentUrl('module=admin');
|
||||
$I->seeElement('#gnbNav');
|
||||
$I->seeElement('#content .x_page-header');
|
||||
$I->see('설치 환경 수집 동의', 'h2');
|
||||
|
||||
|
|
@ -3,13 +3,13 @@ use \Codeception\Configuration;
|
|||
|
||||
$I = new InstallTester($scenario);
|
||||
|
||||
$config = (!$this->env) ? Configuration::config() : Configuration::suiteEnvironments('install')[$this->env];
|
||||
$config = (!$this->env) ? Configuration::suiteSettings('Install', Configuration::config()) : Configuration::suiteEnvironments('Install')[$this->env];
|
||||
|
||||
$db_config = $config['modules']['config']['Db'];
|
||||
|
||||
$dsn = $db_config['dsn'];
|
||||
$dsn = split('[;:]', $dsn);
|
||||
$db_type = array_shift($dsn);
|
||||
|
||||
$dbinfo = [
|
||||
'type' => $db_type,
|
||||
'user' => $db_config['user'],
|
||||
|
|
@ -17,12 +17,15 @@ $dbinfo = [
|
|||
'dbname' => 'xe_install',
|
||||
'port' => ((isset($db_config['port']) && $db_config['port'])?: 3306),
|
||||
];
|
||||
|
||||
foreach($dsn as $piece) {
|
||||
list($key, $val) = explode('=', $piece);
|
||||
$dbinfo[$key] = $val;
|
||||
}
|
||||
|
||||
if(\Filehandler::exists(_XE_PATH_ . 'config/install.config.php')) {
|
||||
$I->deleteFile(_XE_PATH_ . 'config/install.config.php');
|
||||
}
|
||||
|
||||
// Step 1
|
||||
$I->wantTo('Install XE Core');
|
||||
$I->amOnPage('/index.php?l=ko');
|
||||
|
|
@ -86,7 +89,6 @@ $I->submitForm('#content form', [
|
|||
]);
|
||||
|
||||
// Step 9
|
||||
$I->wantTo('completed');
|
||||
$I->dontSeeElement('//div[@id="progress"]/ul/li');
|
||||
$I->amOnPage('/index.php?act=dispMemberLoginForm');
|
||||
|
||||
|
|
@ -1,12 +1,15 @@
|
|||
<?php //[STAMP] 91974ab12b2894dae8d1464cac50fa5d
|
||||
<?php //[STAMP] 655f3852f47c53f31093f448f1b7f2c5
|
||||
|
||||
// This class was automatically generated by build task
|
||||
// You should not change it manually as it will be overwritten on next build
|
||||
// @codingStandardsIgnoreFile
|
||||
|
||||
|
||||
use Codeception\Module\Db;
|
||||
use Codeception\Module\PhpBrowser;
|
||||
use Codeception\Module\installHelper;
|
||||
use Codeception\Module\DbDropTablesHelper;
|
||||
use Codeception\Module\InstallHelper;
|
||||
use Codeception\Module\Filesystem;
|
||||
|
||||
/**
|
||||
* Inherited Methods
|
||||
|
|
@ -26,6 +29,174 @@ use Codeception\Module\installHelper;
|
|||
class InstallTester extends \Codeception\Actor
|
||||
{
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Inserts SQL record into database. This record will be erased after the test.
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->haveInDatabase('users', array('name' => 'miles', 'email' => 'miles@davis.com'));
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $table
|
||||
* @param array $data
|
||||
*
|
||||
* @return integer $id
|
||||
* @see \Codeception\Module\Db::haveInDatabase()
|
||||
*/
|
||||
public function haveInDatabase($table, $data) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('haveInDatabase', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks if a row with given column values exists.
|
||||
* Provide table name and column values.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
|
||||
*
|
||||
* ```
|
||||
* Will generate:
|
||||
*
|
||||
* ``` sql
|
||||
* SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert@mail.com'
|
||||
* ```
|
||||
* Fails if no such user found.
|
||||
*
|
||||
* @param $table
|
||||
* @param array $criteria
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Db::seeInDatabase()
|
||||
*/
|
||||
public function canSeeInDatabase($table, $criteria = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInDatabase', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks if a row with given column values exists.
|
||||
* Provide table name and column values.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
|
||||
*
|
||||
* ```
|
||||
* Will generate:
|
||||
*
|
||||
* ``` sql
|
||||
* SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert@mail.com'
|
||||
* ```
|
||||
* Fails if no such user found.
|
||||
*
|
||||
* @param $table
|
||||
* @param array $criteria
|
||||
* @see \Codeception\Module\Db::seeInDatabase()
|
||||
*/
|
||||
public function seeInDatabase($table, $criteria = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInDatabase', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Effect is opposite to ->seeInDatabase
|
||||
*
|
||||
* Checks if there is no record with such column values in database.
|
||||
* Provide table name and column values.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->dontSeeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
|
||||
*
|
||||
* ```
|
||||
* Will generate:
|
||||
*
|
||||
* ``` sql
|
||||
* SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert@mail.com'
|
||||
* ```
|
||||
* Fails if such user was found.
|
||||
*
|
||||
* @param $table
|
||||
* @param array $criteria
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Db::dontSeeInDatabase()
|
||||
*/
|
||||
public function cantSeeInDatabase($table, $criteria = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInDatabase', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Effect is opposite to ->seeInDatabase
|
||||
*
|
||||
* Checks if there is no record with such column values in database.
|
||||
* Provide table name and column values.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->dontSeeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
|
||||
*
|
||||
* ```
|
||||
* Will generate:
|
||||
*
|
||||
* ``` sql
|
||||
* SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert@mail.com'
|
||||
* ```
|
||||
* Fails if such user was found.
|
||||
*
|
||||
* @param $table
|
||||
* @param array $criteria
|
||||
* @see \Codeception\Module\Db::dontSeeInDatabase()
|
||||
*/
|
||||
public function dontSeeInDatabase($table, $criteria = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInDatabase', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Fetches a single column value from a database.
|
||||
* Provide table name, desired column and criteria.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $mail = $I->grabFromDatabase('users', 'email', array('name' => 'Davert'));
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @version 1.1
|
||||
*
|
||||
* @param $table
|
||||
* @param $column
|
||||
* @param array $criteria
|
||||
*
|
||||
* @return mixed
|
||||
* @see \Codeception\Module\Db::grabFromDatabase()
|
||||
*/
|
||||
public function grabFromDatabase($table, $column, $criteria = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('grabFromDatabase', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
|
|
@ -1915,4 +2086,348 @@ class InstallTester extends \Codeception\Actor
|
|||
public function dontSeeInTitle($title) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInTitle', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
*
|
||||
* @see \Codeception\Module\DbDropTablesHelper::cleanup()
|
||||
*/
|
||||
public function cleanup() {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('cleanup', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Enters a directory In local filesystem.
|
||||
* Project root directory is used by default
|
||||
*
|
||||
* @param $path
|
||||
* @see \Codeception\Module\Filesystem::amInPath()
|
||||
*/
|
||||
public function amInPath($path) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Condition('amInPath', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Opens a file and stores it's content.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('composer.json');
|
||||
* $I->seeInThisFile('codeception/codeception');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $filename
|
||||
* @see \Codeception\Module\Filesystem::openFile()
|
||||
*/
|
||||
public function openFile($filename) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('openFile', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Deletes a file
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->deleteFile('composer.lock');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $filename
|
||||
* @see \Codeception\Module\Filesystem::deleteFile()
|
||||
*/
|
||||
public function deleteFile($filename) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('deleteFile', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Deletes directory with all subdirectories
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->deleteDir('vendor');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $dirname
|
||||
* @see \Codeception\Module\Filesystem::deleteDir()
|
||||
*/
|
||||
public function deleteDir($dirname) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('deleteDir', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Copies directory with all contents
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->copyDir('vendor','old_vendor');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $src
|
||||
* @param $dst
|
||||
* @see \Codeception\Module\Filesystem::copyDir()
|
||||
*/
|
||||
public function copyDir($src, $dst) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('copyDir', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks If opened file has `text` in it.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('composer.json');
|
||||
* $I->seeInThisFile('codeception/codeception');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Filesystem::seeInThisFile()
|
||||
*/
|
||||
public function canSeeInThisFile($text) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInThisFile', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks If opened file has `text` in it.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('composer.json');
|
||||
* $I->seeInThisFile('codeception/codeception');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* @see \Codeception\Module\Filesystem::seeInThisFile()
|
||||
*/
|
||||
public function seeInThisFile($text) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInThisFile', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks the strict matching of file contents.
|
||||
* Unlike `seeInThisFile` will fail if file has something more than expected lines.
|
||||
* Better to use with HEREDOC strings.
|
||||
* Matching is done after removing "\r" chars from file content.
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('process.pid');
|
||||
* $I->seeFileContentsEqual('3192');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Filesystem::seeFileContentsEqual()
|
||||
*/
|
||||
public function canSeeFileContentsEqual($text) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileContentsEqual', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks the strict matching of file contents.
|
||||
* Unlike `seeInThisFile` will fail if file has something more than expected lines.
|
||||
* Better to use with HEREDOC strings.
|
||||
* Matching is done after removing "\r" chars from file content.
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('process.pid');
|
||||
* $I->seeFileContentsEqual('3192');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* @see \Codeception\Module\Filesystem::seeFileContentsEqual()
|
||||
*/
|
||||
public function seeFileContentsEqual($text) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileContentsEqual', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks If opened file doesn't contain `text` in it
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('composer.json');
|
||||
* $I->dontSeeInThisFile('codeception/codeception');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Filesystem::dontSeeInThisFile()
|
||||
*/
|
||||
public function cantSeeInThisFile($text) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInThisFile', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks If opened file doesn't contain `text` in it
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('composer.json');
|
||||
* $I->dontSeeInThisFile('codeception/codeception');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* @see \Codeception\Module\Filesystem::dontSeeInThisFile()
|
||||
*/
|
||||
public function dontSeeInThisFile($text) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInThisFile', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Deletes a file
|
||||
* @see \Codeception\Module\Filesystem::deleteThisFile()
|
||||
*/
|
||||
public function deleteThisFile() {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('deleteThisFile', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks if file exists in path.
|
||||
* Opens a file when it's exists
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeFileFound('UserModel.php','app/models');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $filename
|
||||
* @param string $path
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Filesystem::seeFileFound()
|
||||
*/
|
||||
public function canSeeFileFound($filename, $path = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileFound', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks if file exists in path.
|
||||
* Opens a file when it's exists
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeFileFound('UserModel.php','app/models');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $filename
|
||||
* @param string $path
|
||||
* @see \Codeception\Module\Filesystem::seeFileFound()
|
||||
*/
|
||||
public function seeFileFound($filename, $path = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileFound', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks if file does not exists in path
|
||||
*
|
||||
* @param $filename
|
||||
* @param string $path
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Filesystem::dontSeeFileFound()
|
||||
*/
|
||||
public function cantSeeFileFound($filename, $path = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeFileFound', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks if file does not exists in path
|
||||
*
|
||||
* @param $filename
|
||||
* @param string $path
|
||||
* @see \Codeception\Module\Filesystem::dontSeeFileFound()
|
||||
*/
|
||||
public function dontSeeFileFound($filename, $path = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeFileFound', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Erases directory contents
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->cleanDir('logs');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $dirname
|
||||
* @see \Codeception\Module\Filesystem::cleanDir()
|
||||
*/
|
||||
public function cleanDir($dirname) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('cleanDir', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Saves contents to file
|
||||
*
|
||||
* @param $filename
|
||||
* @param $contents
|
||||
* @see \Codeception\Module\Filesystem::writeToFile()
|
||||
*/
|
||||
public function writeToFile($filename, $contents) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('writeToFile', func_get_args()));
|
||||
}
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
// This is global bootstrap for autoloading
|
||||
if(!defined('__XE__')) define('__XE__', true);
|
||||
if(!defined('_XE_PATH_')) define('_XE_PATH_', realpath(dirname(__FILE__).'/../').'/');
|
||||
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING ^ E_STRICT);
|
||||
require_once _XE_PATH_.'config/config.inc.php';
|
||||
|
||||
function _debug() {
|
||||
$args = func_get_args();
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
<?php
|
||||
namespace Codeception\Module;
|
||||
|
||||
// here you can define custom actions
|
||||
// all public methods declared in helper class will be available in $I
|
||||
|
||||
class AcceptanceHelper extends \Codeception\Module
|
||||
{
|
||||
|
||||
}
|
||||
24
tests/_support/DbDropTablesHelper.php
Normal file
24
tests/_support/DbDropTablesHelper.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
namespace Codeception\Module;
|
||||
|
||||
class DbDropTablesHelper extends \Codeception\Module\Db
|
||||
{
|
||||
protected $requiredFields = [];
|
||||
|
||||
public function cleanup()
|
||||
{
|
||||
$dbh = $this->driver->getDbh();
|
||||
if (!$dbh) {
|
||||
throw new ModuleConfigException(
|
||||
__CLASS__,
|
||||
"No connection to database. Remove this module from config if you don't need database repopulation"
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
$this->driver->cleanup();
|
||||
} catch (\Exception $e) {
|
||||
throw new ModuleException(__CLASS__, $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<?php
|
||||
namespace Codeception\Module;
|
||||
|
||||
// here you can define custom actions
|
||||
// all public methods declared in helper class will be available in $I
|
||||
|
||||
class FunctionalHelper extends \Codeception\Module
|
||||
{
|
||||
|
||||
}
|
||||
12
tests/_support/InstallHelper.php
Normal file
12
tests/_support/InstallHelper.php
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
namespace Codeception\Module;
|
||||
|
||||
use Codeception\Util\FileSystem;
|
||||
|
||||
class InstallHelper extends \Codeception\Module
|
||||
{
|
||||
public function _before()
|
||||
{
|
||||
FileSystem::deleteDir('files');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<?php
|
||||
namespace Codeception\Module;
|
||||
|
||||
class installHelper extends \Codeception\Module
|
||||
{
|
||||
public function _initialize()
|
||||
{
|
||||
\Codeception\Util\FileSystem::deleteDir('files');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
class_name: AcceptanceTester
|
||||
modules:
|
||||
enabled:
|
||||
- PhpBrowser
|
||||
- AcceptanceHelper
|
||||
config:
|
||||
PhpBrowser:
|
||||
url: 'http://localhost/'
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,9 +0,0 @@
|
|||
# Codeception Test Suite Configuration
|
||||
|
||||
# suite for functional (integration) tests.
|
||||
# emulate web requests and make application process them.
|
||||
# Include one of framework modules (Symfony2, Yii2, Laravel4) to use it.
|
||||
|
||||
class_name: FunctionalTester
|
||||
modules:
|
||||
enabled: [Filesystem, FunctionalHelper]
|
||||
|
|
@ -1,360 +0,0 @@
|
|||
<?php //[STAMP] bdc43d9c472c8c86c136dc49b64a1a3a
|
||||
|
||||
// This class was automatically generated by build task
|
||||
// You should not change it manually as it will be overwritten on next build
|
||||
// @codingStandardsIgnoreFile
|
||||
|
||||
|
||||
use Codeception\Module\Filesystem;
|
||||
use Codeception\Module\FunctionalHelper;
|
||||
|
||||
/**
|
||||
* Inherited Methods
|
||||
* @method void wantToTest($text)
|
||||
* @method void wantTo($text)
|
||||
* @method void execute($callable)
|
||||
* @method void expectTo($prediction)
|
||||
* @method void expect($prediction)
|
||||
* @method void amGoingTo($argumentation)
|
||||
* @method void am($role)
|
||||
* @method void lookForwardTo($achieveValue)
|
||||
* @method void comment($description)
|
||||
* @method void haveFriend($name, $actorClass = null)
|
||||
*
|
||||
* @SuppressWarnings(PHPMD)
|
||||
*/
|
||||
class FunctionalTester extends \Codeception\Actor
|
||||
{
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Enters a directory In local filesystem.
|
||||
* Project root directory is used by default
|
||||
*
|
||||
* @param $path
|
||||
* @see \Codeception\Module\Filesystem::amInPath()
|
||||
*/
|
||||
public function amInPath($path) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Condition('amInPath', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Opens a file and stores it's content.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('composer.json');
|
||||
* $I->seeInThisFile('codeception/codeception');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $filename
|
||||
* @see \Codeception\Module\Filesystem::openFile()
|
||||
*/
|
||||
public function openFile($filename) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('openFile', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Deletes a file
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->deleteFile('composer.lock');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $filename
|
||||
* @see \Codeception\Module\Filesystem::deleteFile()
|
||||
*/
|
||||
public function deleteFile($filename) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('deleteFile', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Deletes directory with all subdirectories
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->deleteDir('vendor');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $dirname
|
||||
* @see \Codeception\Module\Filesystem::deleteDir()
|
||||
*/
|
||||
public function deleteDir($dirname) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('deleteDir', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Copies directory with all contents
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->copyDir('vendor','old_vendor');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $src
|
||||
* @param $dst
|
||||
* @see \Codeception\Module\Filesystem::copyDir()
|
||||
*/
|
||||
public function copyDir($src, $dst) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('copyDir', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks If opened file has `text` in it.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('composer.json');
|
||||
* $I->seeInThisFile('codeception/codeception');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Filesystem::seeInThisFile()
|
||||
*/
|
||||
public function canSeeInThisFile($text) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInThisFile', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks If opened file has `text` in it.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('composer.json');
|
||||
* $I->seeInThisFile('codeception/codeception');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* @see \Codeception\Module\Filesystem::seeInThisFile()
|
||||
*/
|
||||
public function seeInThisFile($text) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInThisFile', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks the strict matching of file contents.
|
||||
* Unlike `seeInThisFile` will fail if file has something more than expected lines.
|
||||
* Better to use with HEREDOC strings.
|
||||
* Matching is done after removing "\r" chars from file content.
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('process.pid');
|
||||
* $I->seeFileContentsEqual('3192');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Filesystem::seeFileContentsEqual()
|
||||
*/
|
||||
public function canSeeFileContentsEqual($text) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileContentsEqual', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks the strict matching of file contents.
|
||||
* Unlike `seeInThisFile` will fail if file has something more than expected lines.
|
||||
* Better to use with HEREDOC strings.
|
||||
* Matching is done after removing "\r" chars from file content.
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('process.pid');
|
||||
* $I->seeFileContentsEqual('3192');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* @see \Codeception\Module\Filesystem::seeFileContentsEqual()
|
||||
*/
|
||||
public function seeFileContentsEqual($text) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileContentsEqual', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks If opened file doesn't contain `text` in it
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('composer.json');
|
||||
* $I->dontSeeInThisFile('codeception/codeception');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Filesystem::dontSeeInThisFile()
|
||||
*/
|
||||
public function cantSeeInThisFile($text) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInThisFile', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks If opened file doesn't contain `text` in it
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('composer.json');
|
||||
* $I->dontSeeInThisFile('codeception/codeception');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* @see \Codeception\Module\Filesystem::dontSeeInThisFile()
|
||||
*/
|
||||
public function dontSeeInThisFile($text) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInThisFile', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Deletes a file
|
||||
* @see \Codeception\Module\Filesystem::deleteThisFile()
|
||||
*/
|
||||
public function deleteThisFile() {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('deleteThisFile', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks if file exists in path.
|
||||
* Opens a file when it's exists
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeFileFound('UserModel.php','app/models');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $filename
|
||||
* @param string $path
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Filesystem::seeFileFound()
|
||||
*/
|
||||
public function canSeeFileFound($filename, $path = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileFound', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks if file exists in path.
|
||||
* Opens a file when it's exists
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeFileFound('UserModel.php','app/models');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $filename
|
||||
* @param string $path
|
||||
* @see \Codeception\Module\Filesystem::seeFileFound()
|
||||
*/
|
||||
public function seeFileFound($filename, $path = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileFound', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks if file does not exists in path
|
||||
*
|
||||
* @param $filename
|
||||
* @param string $path
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Filesystem::dontSeeFileFound()
|
||||
*/
|
||||
public function cantSeeFileFound($filename, $path = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeFileFound', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks if file does not exists in path
|
||||
*
|
||||
* @param $filename
|
||||
* @param string $path
|
||||
* @see \Codeception\Module\Filesystem::dontSeeFileFound()
|
||||
*/
|
||||
public function dontSeeFileFound($filename, $path = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeFileFound', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Erases directory contents
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->cleanDir('logs');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $dirname
|
||||
* @see \Codeception\Module\Filesystem::cleanDir()
|
||||
*/
|
||||
public function cleanDir($dirname) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('cleanDir', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Saves contents to file
|
||||
*
|
||||
* @param $filename
|
||||
* @param $contents
|
||||
* @see \Codeception\Module\Filesystem::writeToFile()
|
||||
*/
|
||||
public function writeToFile($filename, $contents) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('writeToFile', func_get_args()));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<?php
|
||||
// Here you can initialize variables that will be available to your tests
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
class_name: InstallTester
|
||||
modules:
|
||||
enabled:
|
||||
- PhpBrowser
|
||||
- installHelper
|
||||
config:
|
||||
PhpBrowser:
|
||||
url: 'http://localhost:8000/'
|
||||
env:
|
||||
travis:
|
||||
modules:
|
||||
config:
|
||||
Db:
|
||||
dsn: 'mysql:host=127.0.0.1;dbname=xe_test'
|
||||
user: 'travis'
|
||||
password: 'travis'
|
||||
cleanup: true
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<?php
|
||||
// Here you can initialize variables that will be available to your tests
|
||||
|
||||
\Codeception\Util\Autoload::registerSuffix('Steps', __DIR__.DIRECTORY_SEPARATOR.'_steps');
|
||||
\Codeception\Util\Autoload::registerSuffix('Page', __DIR__.DIRECTORY_SEPARATOR.'_pages');
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<?php
|
||||
|
||||
class installPage
|
||||
{
|
||||
// include url of current page
|
||||
public static $URL = '';
|
||||
|
||||
/**
|
||||
* Declare UI map for this page here. CSS or XPath allowed.
|
||||
* public static $usernameField = '#username';
|
||||
* public static $formSubmitButton = "#mainForm input[type=submit]";
|
||||
*/
|
||||
|
||||
/**
|
||||
* Basic route example for your current URL
|
||||
* You can append any additional parameter to URL
|
||||
* and use it in tests like: EditPage::route('/123-post');
|
||||
*/
|
||||
public static function route($param)
|
||||
{
|
||||
return static::$URL.$param;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var InstallTester;
|
||||
*/
|
||||
protected $installTester;
|
||||
|
||||
public function __construct(InstallTester $I)
|
||||
{
|
||||
$this->installTester = $I;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return installPage
|
||||
*/
|
||||
public static function of(InstallTester $I)
|
||||
{
|
||||
return new static($I);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
namespace InstallTester;
|
||||
|
||||
class AdminSteps extends \InstallTester
|
||||
{
|
||||
public function login()
|
||||
{
|
||||
$I = $this;
|
||||
}
|
||||
public function adminLogin()
|
||||
{
|
||||
$I = $this;
|
||||
}
|
||||
public function logout()
|
||||
{
|
||||
$I = $this;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<?php //[STAMP] 12ed79a2e487867b140068ed6d5a381b
|
||||
<?php //[STAMP] bd6b55949e6a72559e6ee503e29432bb
|
||||
|
||||
// This class was automatically generated by build task
|
||||
// You should not change it manually as it will be overwritten on next build
|
||||
|
|
|
|||
|
|
@ -1,4 +1,2 @@
|
|||
<?php
|
||||
$_SERVER['SCRIPT_NAME'] = '/xe/index.php';
|
||||
|
||||
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING ^ E_STRICT);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,12 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
|
|||
$handler->loadFile(array('./common/js/common.js', 'head'));
|
||||
$handler->loadFile(array('./common/js/xml_js_filter.js', 'body'));
|
||||
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => null);
|
||||
if(__DEBUG__ || !__XE_VERSION_STABLE__)
|
||||
{
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => null);
|
||||
} else {
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.min.js' . $this->_filemtime('common/js/jquery.min.js'), 'targetie' => null);
|
||||
}
|
||||
$expected[] = array('file' => '/xe/common/js/js_app.js' . $this->_filemtime('common/js/js_app.js'), 'targetie' => null);
|
||||
$expected[] = array('file' => '/xe/common/js/common.js' . $this->_filemtime('common/js/common.js'), 'targetie' => null);
|
||||
$this->assertEquals($handler->getJsFileList(), $expected);
|
||||
|
|
@ -33,7 +38,14 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
|
|||
$handler->loadFile(array('./common/js/jquery.js', 'body'));
|
||||
$handler->loadFile(array('./common/js/xml_js_filter.js', 'head'));
|
||||
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => null);
|
||||
if(__DEBUG__ || !__XE_VERSION_STABLE__)
|
||||
{
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => null);
|
||||
}
|
||||
else
|
||||
{
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.min.js' . $this->_filemtime('common/js/jquery.min.js'), 'targetie' => null);
|
||||
}
|
||||
$this->assertEquals($handler->getJsFileList('body'), $expected);
|
||||
});
|
||||
|
||||
|
|
@ -42,8 +54,16 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
|
|||
$handler->loadFile(array('./common/css/xe.css'));
|
||||
$handler->loadFile(array('./common/css/mobile.css'));
|
||||
|
||||
$expected[] = array('file' => '/xe/common/css/xe.css' . $this->_filemtime('common/css/xe.css'), 'media' => 'all', 'targetie' => null);
|
||||
$expected[] = array('file' => '/xe/common/css/mobile.css' . $this->_filemtime('common/css/mobile.css'), 'media' => 'all', 'targetie' => null);
|
||||
if(__DEBUG__ || !__XE_VERSION_STABLE__)
|
||||
{
|
||||
$expected[] = array('file' => '/xe/common/css/xe.css' . $this->_filemtime('common/css/xe.css'), 'media' => 'all', 'targetie' => null);
|
||||
$expected[] = array('file' => '/xe/common/css/mobile.css' . $this->_filemtime('common/css/mobile.css'), 'media' => 'all', 'targetie' => null);
|
||||
}
|
||||
else
|
||||
{
|
||||
$expected[] = array('file' => '/xe/common/css/xe.min.css' . $this->_filemtime('common/css/xe.min.css'), 'media' => 'all', 'targetie' => null);
|
||||
$expected[] = array('file' => '/xe/common/css/mobile.min.css' . $this->_filemtime('common/css/mobile.min.css'), 'media' => 'all', 'targetie' => null);
|
||||
}
|
||||
$this->assertEquals($handler->getCssFileList(), $expected);
|
||||
});
|
||||
|
||||
|
|
@ -60,7 +80,14 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
|
|||
$handler->loadFile(array('./common/js/xml_handler.js', 'head', '', -100000));
|
||||
$handler->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -100000));
|
||||
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => null);
|
||||
if(__DEBUG__ || !__XE_VERSION_STABLE__)
|
||||
{
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => null);
|
||||
}
|
||||
else
|
||||
{
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.min.js' . $this->_filemtime('common/js/jquery.min.js'), 'targetie' => null);
|
||||
}
|
||||
$expected[] = array('file' => '/xe/common/js/js_app.js' . $this->_filemtime('common/js/js_app.js'), 'targetie' => null);
|
||||
$expected[] = array('file' => '/xe/common/js/common.js' . $this->_filemtime('common/js/common.js'), 'targetie' => null);
|
||||
$expected[] = array('file' => '/xe/common/js/xml_handler.js' . $this->_filemtime('common/js/xml_handler.js'), 'targetie' => null);
|
||||
|
|
@ -76,7 +103,14 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
|
|||
$handler->loadFile(array('./common/js/common.js', 'head', '', -100000));
|
||||
$handler->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -100000));
|
||||
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => null);
|
||||
if(__DEBUG__ || !__XE_VERSION_STABLE__)
|
||||
{
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => null);
|
||||
}
|
||||
else
|
||||
{
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.min.js' . $this->_filemtime('common/js/jquery.min.js'), 'targetie' => null);
|
||||
}
|
||||
$expected[] = array('file' => '/xe/common/js/js_app.js' . $this->_filemtime('common/js/js_app.js'), 'targetie' => null);
|
||||
$expected[] = array('file' => '/xe/common/js/common.js' . $this->_filemtime('common/js/common.js'), 'targetie' => null);
|
||||
$expected[] = array('file' => '/xe/common/js/xml_js_filter.js' . $this->_filemtime('common/js/xml_js_filter.js'), 'targetie' => null);
|
||||
|
|
@ -106,9 +140,41 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
|
|||
$handler->loadFile(array('./common/js/jquery.js', 'head', 'ie7'));
|
||||
$handler->loadFile(array('./common/js/jquery.js', 'head', 'ie8'));
|
||||
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => 'ie6');
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => 'ie7');
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => 'ie8');
|
||||
if(__DEBUG__ || !__XE_VERSION_STABLE__)
|
||||
{
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => 'ie6');
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => 'ie7');
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => 'ie8');
|
||||
}
|
||||
else
|
||||
{
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.min.js' . $this->_filemtime('common/js/jquery.min.js'), 'targetie' => 'ie6');
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.min.js' . $this->_filemtime('common/js/jquery.min.js'), 'targetie' => 'ie7');
|
||||
$expected[] = array('file' => '/xe/common/js/jquery.min.js' . $this->_filemtime('common/js/jquery.min.js'), 'targetie' => 'ie8');
|
||||
}
|
||||
$this->assertEquals($handler->getJsFileList(), $expected);
|
||||
});
|
||||
|
||||
$this->specify("external file - schemaless", function() {
|
||||
$handler = new FrontEndFileHandler();
|
||||
$handler->loadFile(array('http://external.host/js/script.js'));
|
||||
$handler->loadFile(array('https://external.host/js/script.js'));
|
||||
$handler->loadFile(array('//external.host/js/script1.js'));
|
||||
$handler->loadFile(array('///external.host/js/script2.js'));
|
||||
|
||||
$expected[] = array('file' => 'http://external.host/js/script.js', 'targetie' => null);
|
||||
$expected[] = array('file' => 'https://external.host/js/script.js', 'targetie' => null);
|
||||
$expected[] = array('file' => '//external.host/js/script1.js', 'targetie' => null);
|
||||
$expected[] = array('file' => '//external.host/js/script2.js', 'targetie' => null);
|
||||
$this->assertEquals($handler->getJsFileList(), $expected);
|
||||
});
|
||||
|
||||
$this->specify("external file - schemaless", function() {
|
||||
$handler = new FrontEndFileHandler();
|
||||
$handler->loadFile(array('//external.host/js/script.js'));
|
||||
$handler->loadFile(array('///external.host/js/script.js'));
|
||||
|
||||
$expected[] = array('file' => '//external.host/js/script.js', 'targetie' => null);
|
||||
$this->assertEquals($handler->getJsFileList(), $expected);
|
||||
});
|
||||
|
||||
|
|
@ -146,13 +212,16 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
|
|||
$this->assertEquals($handler->getCssFileList(), $expected);
|
||||
});
|
||||
|
||||
$this->specify("external file", function() {
|
||||
$this->specify("external file - schemaless", function() {
|
||||
$handler = new FrontEndFileHandler();
|
||||
$handler->loadFile(array('//external.host/css/style.css'));
|
||||
$handler->loadFile(array('///external.host/css2/style2.css'));
|
||||
|
||||
$expected[] = array('file' => '//external.host/css/style.css', 'media'=>'all', 'targetie' => null);
|
||||
$expected[] = array('file' => '//external.host/css2/style2.css', 'media'=>'all', 'targetie' => null);
|
||||
$this->assertEquals($handler->getCssFileList(), $expected);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ class TemplateHandlerTest extends \Codeception\TestCase\Test
|
|||
// issue 584
|
||||
array(
|
||||
'<img cond="$oBodex->display_extra_images[\'mobile\'] && $arr_extra && $arr_extra->bodex->mobile" src="./images/common/mobile.gif" title="mobile" alt="mobile" />',
|
||||
PHP_EOL . 'if($__Context->oBodex->display_extra_images[\'mobile\'] && $__Context->arr_extra && $__Context->arr_extra->bodex->mobile){ ?><img src="./images/common/mobile.gif" title="mobile" alt="mobile" /><?php } ?>'
|
||||
PHP_EOL . 'if($__Context->oBodex->display_extra_images[\'mobile\'] && $__Context->arr_extra && $__Context->arr_extra->bodex->mobile){ ?><img src="/xe/tests/unit/classes/template/images/common/mobile.gif" title="mobile" alt="mobile" /><?php } ?>'
|
||||
),
|
||||
// issue 831
|
||||
array(
|
||||
|
|
@ -230,6 +230,55 @@ class TemplateHandlerTest extends \Codeception\TestCase\Test
|
|||
'{@ eval(\'$val = $document_srl;\')}',
|
||||
PHP_EOL . 'eval(\'$__Context->val = $__Context->document_srl;\') ?>'
|
||||
),
|
||||
// https://github.com/xpressengine/xe-core/issues/1510
|
||||
array(
|
||||
'<img cond="$foo->bar" src="../common/mobile.gif" />',
|
||||
PHP_EOL . 'if($__Context->foo->bar){ ?><img src="/xe/tests/unit/classes/common/mobile.gif" /><?php } ?>'
|
||||
),
|
||||
// https://github.com/xpressengine/xe-core/issues/1510
|
||||
array(
|
||||
'<img cond="$foo->bar > 100" alt="a!@#$%^&*()_-=[]{}?/" src="../common/mobile.gif" />',
|
||||
PHP_EOL . 'if($__Context->foo->bar > 100){ ?><img alt="a!@#$%^&*()_-=[]{}?/" src="/xe/tests/unit/classes/common/mobile.gif" /><?php } ?>'
|
||||
),
|
||||
// https://github.com/xpressengine/xe-core/issues/1510
|
||||
array(
|
||||
'<img src="../common/mobile.gif" cond="$foo->bar" />',
|
||||
PHP_EOL . 'if($__Context->foo->bar){ ?><img src="/xe/tests/unit/classes/common/mobile.gif" /><?php } ?>'
|
||||
),
|
||||
// https://github.com/xpressengine/xe-core/issues/1510
|
||||
array(
|
||||
'<img class="tmp_class" cond="!$module_info->title" src="../img/common/blank.gif" />',
|
||||
PHP_EOL . 'if(!$__Context->module_info->title){ ?><img class="tmp_class" src="/xe/tests/unit/classes/img/common/blank.gif" /><?php } ?>'
|
||||
),
|
||||
// https://github.com/xpressengine/xe-core/issues/1510
|
||||
array(
|
||||
'<img cond="$mi->title" class="tmp_class"|cond="$mi->use" src="../img/common/blank.gif" />',
|
||||
PHP_EOL . 'if($__Context->mi->title){ ?><img<?php if($__Context->mi->use){ ?> class="tmp_class"<?php } ?> src="/xe/tests/unit/classes/img/common/blank.gif" /><?php } ?>'
|
||||
),
|
||||
array(
|
||||
'<input foo="bar" /> <img cond="$foo->bar" alt="alt" src="../common/mobile.gif" />',
|
||||
'?><input foo="bar" /> <?php if($__Context->foo->bar){ ?><img alt="alt" src="/xe/tests/unit/classes/common/mobile.gif" /><?php } ?>'
|
||||
),
|
||||
array(
|
||||
'<input foo="bar" />' . "\n" . '<input foo="bar" /> <img cond="$foo->bar" alt="alt" src="../common/mobile.gif" />',
|
||||
'?><input foo="bar" />' . PHP_EOL . '<input foo="bar" /> <?php if($__Context->foo->bar){ ?><img alt="alt" src="/xe/tests/unit/classes/common/mobile.gif" /><?php } ?>'
|
||||
),
|
||||
array(
|
||||
'asf <img src="{$foo->bar}" />',
|
||||
'?>asf <img src="<?php echo $__Context->foo->bar ?>" />'
|
||||
),
|
||||
array(
|
||||
'<img alt="" '.PHP_EOL.' src="../myxe/xe/img.png" />',
|
||||
'?><img alt="" '.PHP_EOL.' src="/xe/tests/unit/classes/myxe/xe/img.png" />'
|
||||
),
|
||||
array(
|
||||
'<input>asdf src="../img/img.gif" asdf</input> <img alt="src" src="../myxe/xe/img.png" /> <input>asdf src="../img/img.gif" asdf</input>',
|
||||
'?><input>asdf src="../img/img.gif" asdf</input> <img alt="src" src="/xe/tests/unit/classes/myxe/xe/img.png" /> <input>asdf src="../img/img.gif" asdf</input>'
|
||||
),
|
||||
array(
|
||||
'<input>asdf src="../img/img.gif" asdf</input>',
|
||||
'?><input>asdf src="../img/img.gif" asdf</input>'
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ class DBMysqliConnectWrapper extends DBMysqli
|
|||
*/
|
||||
public function addQuotes($string)
|
||||
{
|
||||
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc())
|
||||
if(version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc())
|
||||
{
|
||||
$string = stripslashes(str_replace("\\", "\\\\", $string));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue