diff --git a/modules/editor/skins/ckeditor/file_upload.html b/modules/editor/skins/ckeditor/file_upload.html
index e7aef9149..59c28b638 100644
--- a/modules/editor/skins/ckeditor/file_upload.html
+++ b/modules/editor/skins/ckeditor/file_upload.html
@@ -55,7 +55,12 @@
limitMultiFileUploadSize: {$file_config->allowed_filesize}
};
var uploader = $('#xefu-container-{$editor_sequence}').xeUploader(setting);
- // console.log(uploader);
+ window.xe.msg_exceeds_limit_size = '{$lang->msg_exceeds_limit_size}';
+ window.xe.msg_checked_file_is_deleted = '{$lang->msg_checked_file_is_deleted}';
+ window.xe.msg_file_cart_is_null = '{$lang->msg_file_cart_is_null}';
+ window.xe.msg_checked_file_is_deleted = '{$lang->msg_checked_file_is_deleted}';
+ window.xe.msg_not_allowed_filetype = '{$lang->msg_not_allowed_filetype}';
+ window.xe.msg_file_upload_error = '{$lang->msg_file_upload_error}';
});
diff --git a/modules/editor/tpl/js/editor.app.js b/modules/editor/tpl/js/editor.app.js
index 678434865..9542619ed 100644
--- a/modules/editor/tpl/js/editor.app.js
+++ b/modules/editor/tpl/js/editor.app.js
@@ -65,6 +65,8 @@
this.editor_sequence = data.editorSequence;
$form.attr('editor_sequence', data.editorSequence);
+
+ if(CKEDITOR.env.mobile) CKEDITOR.env.isCompatible = true;
var instance = CKEDITOR.appendTo($containerEl[0], {}, $contentField.val());
diff --git a/modules/editor/tpl/js/editor.app.min.js b/modules/editor/tpl/js/editor.app.min.js
index e096b79c2..c11157caa 100644
--- a/modules/editor/tpl/js/editor.app.min.js
+++ b/modules/editor/tpl/js/editor.app.min.js
@@ -1 +1 @@
-!function(a){"use strict";function b(b){return a.grep(b,function(c,d){return c.length&&a.inArray(c,b)===d})}var c={bodyClass:"xe_content editable",toolbarCanCollapse:!0,toolbarGroups:[{name:"clipboard",groups:["undo","clipboard"]},{name:"editing",groups:["find","selection"]},{name:"links"},{name:"insert"},{name:"tools"},{name:"document",groups:["mode"]},"/",{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi"]},"/",{name:"styles"},{name:"colors"},{name:"xecomponent"},{name:"others"}],allowedContent:!0,removePlugins:"stylescombo,language,bidi,flash,pagebreak",removeButtons:"Save,Preview,Print,Cut,Copy,Paste",uiColor:"#EFF0F0"},d=xe.createApp("XeCkEditor",{ckeconfig:{},editor_sequence:null,init:function(){var a=this;CKEDITOR.on("instanceCreated",function(){a.cast("CKEDITOR_CREATED")}),CKEDITOR.on("ready",function(){a.cast("CKEDITOR_READY")}),CKEDITOR.on("instanceReady",function(){a.cast("CKEDITOR_INSTANCE_READY")}),CKEDITOR.on("instanceLoaded",function(){a.cast("CKEDITOR_LOADED")})},editorInit:function(d,e){{var f=this,g=d,h=g.closest("form"),i=e.content_field,j=g.data();g.data().editorSequence}this.ckeconfig=a.extend({},c,e.ckeconfig||{}),this.editor_sequence=j.editorSequence,h.attr("editor_sequence",j.editorSequence);var k=CKEDITOR.appendTo(g[0],{},i.val());k.on("customConfigLoaded",function(d){if(k.config=a.extend({},d.editor.config,f.ckeconfig),a.isFunction(CKEDITOR.editorConfig)){var g={};CKEDITOR.editorConfig(g),a.each(g,function(a,b){k.config[a]=b})}var h=d.editor.config.bodyClass.split(" ");if(h.push(c.bodyClass),h=b(h),k.config.bodyClass=h.join(" "),e.loadXeComponent){var i=d.editor.config.extraPlugins.split(",");i.push("xe_component"),i=b(i),k.config.extraPlugins=i.join(",")}e.enableToolbar||(k.config.toolbar=[])}),g.data("cke_instance",k),window.editorRelKeys[j.editorSequence]={},window.editorRelKeys[j.editorSequence].primary=h.find("[name="+j.editorPrimaryKeyName+"]")[0],window.editorRelKeys[j.editorSequence].content=h.find("[name="+j.editorContentKeyName+"]")[0],window.editorRelKeys[j.editorSequence].func=function(a){return f.getContent.call(f,a)},window.editorRelKeys[j.editorSequence].pasteHTML=function(a){k.insertHtml(a,"html")}},getContent:function(a){var b=this,c=_getCkeInstance(a).getData();return b.cast("GET_CONTENT",[c]),c},getInstance:function(a){return CKEDITOR.instances[a]},API_EDITOR_CREATED:function(){}});a.fn.XeCkEditor=function(a){var b=new d(this.eq(0),a);return b&&(xe.registerApp(b),b.editorInit(this.eq(0),a)),b},window.xe.XeCkEditor=function(){var a=new d;return a}}(jQuery);
\ No newline at end of file
+!function(a){"use strict";function b(b){return a.grep(b,function(c,d){return c.length&&a.inArray(c,b)===d})}var c={bodyClass:"xe_content editable",toolbarCanCollapse:!0,toolbarGroups:[{name:"clipboard",groups:["undo","clipboard"]},{name:"editing",groups:["find","selection"]},{name:"links"},{name:"insert"},{name:"tools"},{name:"document",groups:["mode"]},"/",{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi"]},"/",{name:"styles"},{name:"colors"},{name:"xecomponent"},{name:"others"}],allowedContent:!0,removePlugins:"stylescombo,language,bidi,flash,pagebreak",removeButtons:"Save,Preview,Print,Cut,Copy,Paste",uiColor:"#EFF0F0"},d=xe.createApp("XeCkEditor",{ckeconfig:{},editor_sequence:null,init:function(){var a=this;CKEDITOR.on("instanceCreated",function(){a.cast("CKEDITOR_CREATED")}),CKEDITOR.on("ready",function(){a.cast("CKEDITOR_READY")}),CKEDITOR.on("instanceReady",function(){a.cast("CKEDITOR_INSTANCE_READY")}),CKEDITOR.on("instanceLoaded",function(){a.cast("CKEDITOR_LOADED")})},editorInit:function(d,e){{var f=this,g=d,h=g.closest("form"),i=e.content_field,j=g.data();g.data().editorSequence}this.ckeconfig=a.extend({},c,e.ckeconfig||{}),this.editor_sequence=j.editorSequence,h.attr("editor_sequence",j.editorSequence),CKEDITOR.env.mobile&&(CKEDITOR.env.isCompatible=!0);var k=CKEDITOR.appendTo(g[0],{},i.val());k.on("customConfigLoaded",function(d){if(k.config=a.extend({},d.editor.config,f.ckeconfig),a.isFunction(CKEDITOR.editorConfig)){var g={};CKEDITOR.editorConfig(g),a.each(g,function(a,b){k.config[a]=b})}var h=d.editor.config.bodyClass.split(" ");if(h.push(c.bodyClass),h=b(h),k.config.bodyClass=h.join(" "),e.loadXeComponent){var i=d.editor.config.extraPlugins.split(",");i.push("xe_component"),i=b(i),k.config.extraPlugins=i.join(",")}e.enableToolbar||(k.config.toolbar=[])}),g.data("cke_instance",k),window.editorRelKeys[j.editorSequence]={},window.editorRelKeys[j.editorSequence].primary=h.find("[name="+j.editorPrimaryKeyName+"]")[0],window.editorRelKeys[j.editorSequence].content=h.find("[name="+j.editorContentKeyName+"]")[0],window.editorRelKeys[j.editorSequence].func=function(a){return f.getContent.call(f,a)},window.editorRelKeys[j.editorSequence].pasteHTML=function(a){k.insertHtml(a,"html")}},getContent:function(a){var b=this,c=_getCkeInstance(a).getData();return b.cast("GET_CONTENT",[c]),c},getInstance:function(a){return CKEDITOR.instances[a]},API_EDITOR_CREATED:function(){}});a.fn.XeCkEditor=function(a){var b=new d(this.eq(0),a);return b&&(xe.registerApp(b),b.editorInit(this.eq(0),a)),b},window.xe.XeCkEditor=function(){var a=new d;return a}}(jQuery);
\ No newline at end of file
diff --git a/modules/install/script/ko.install.php b/modules/install/script/ko.install.php
index a1b98708e..92ba4cbb6 100644
--- a/modules/install/script/ko.install.php
+++ b/modules/install/script/ko.install.php
@@ -22,24 +22,24 @@ $sitemap = array(
'module_id' => 'board',
'list' => array(
array(
- 'menu_name' => 'SMAPLE 1',
+ 'menu_name' => 'SAMPLE 1',
'is_shortcut' => 'Y',
'shortcut_target' => '#',
'list' => array(
array(
- 'menu_name' => 'SMAPLE 1-1',
+ 'menu_name' => 'SAMPLE 1-1',
'is_shortcut' => 'Y',
'shortcut_target' => '#'
),
)
),
array(
- 'menu_name' => 'SMAPLE 2',
+ 'menu_name' => 'SAMPLE 2',
'is_shortcut' => 'Y',
'shortcut_target' => '#'
),
array(
- 'menu_name' => 'SMAPLE 3',
+ 'menu_name' => 'SAMPLE 3',
'is_shortcut' => 'Y',
'shortcut_target' => '#'
),
@@ -175,16 +175,12 @@ foreach($sitemap as $id => &$val)
$oMenuAdminController->makeHomemenuCacheFile($val['menu_srl']);
}
-
-
// create Layout
//extra_vars init
$extra_vars = new stdClass();
$extra_vars->GNB = $sitemap['GNB']['menu_srl'];
-$extra_vars->UNB = $simtemap['UNB']['menu_srl'];
-$extra_vars->FNB = $simtemap['FNB']['menu_srl'];
-$extra_vars->menu_name_list = array();
-$extra_vars->menu_name_list[$sitemap['GNB']['menu_srl']] = 'Welcome menu';
+$extra_vars->UNB = $sitemap['UNB']['menu_srl'];
+$extra_vars->FNB = $sitemap['FNB']['menu_srl'];
$args = new stdClass();
$layout_srl = $args->layout_srl = getNextSequence();
diff --git a/modules/member/queries/chkAuthMail.xml b/modules/member/queries/chkAuthMail.xml
index 9505632a9..34911c35f 100644
--- a/modules/member/queries/chkAuthMail.xml
+++ b/modules/member/queries/chkAuthMail.xml
@@ -1,4 +1,4 @@
-
+
diff --git a/modules/menu/menu.admin.controller.php b/modules/menu/menu.admin.controller.php
index 960f0f584..c468d8cb7 100644
--- a/modules/menu/menu.admin.controller.php
+++ b/modules/menu/menu.admin.controller.php
@@ -606,8 +606,7 @@ class menuAdminController extends menu
$cmArgs->is_skin_fix = 'N';
$cmArgs->is_mskin_fix = 'N';
- $db_info = Context::getDBInfo();
- if($db_info->use_mobile_view == 'Y')
+ if(Mobile::isMobileEnabled() === true)
{
$cmArgs->use_mobile = 'Y';
}
diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php
deleted file mode 100644
index 28119bdb3..000000000
--- a/tests/Bootstrap.php
+++ /dev/null
@@ -1,26 +0,0 @@
- */
-
-if(!defined('__DEBUG__')) define('__DEBUG__', 1);
-if(!defined('__XE__')) define('__XE__', true);
-if(!defined('__ZBXE__')) define('__ZBXE__', true);
-if(!defined('_XE_PATH_')) define('_XE_PATH_', realpath(dirname(__FILE__).'/../').'/');
-
-$_SERVER['SCRIPT_NAME'] = '/xe/index.php';
-error_reporting(E_ALL & ~E_NOTICE);
-
-/**
- * Print out the message
- **/
-function _log($msg) {
- $args = func_get_args();
-
- foreach($args as $arg) {
- fwrite(STDOUT, "\n");
- fwrite(STDOUT, print_r($arg, true));
- }
- fwrite(STDOUT, "\n");
-}
-
-/* End of file Bootstrap.php */
-/* Location: ./tests/Bootstrap.php */
diff --git a/tests/_bootstrap.php b/tests/_bootstrap.php
new file mode 100644
index 000000000..e0d603d32
--- /dev/null
+++ b/tests/_bootstrap.php
@@ -0,0 +1,3 @@
+setHeader('X-Requested-With', 'Codeception');
+ * $I->amOnPage('test-headers.php');
+ * ?>
+ * ```
+ *
+ * @param string $name the name of the request header
+ * @param string $value the value to set it to for subsequent
+ * requests
+ * @see \Codeception\Module\PhpBrowser::setHeader()
+ */
+ public function setHeader($name, $value) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('setHeader', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Deletes the header with the passed name. Subsequent requests
+ * will not have the deleted header in its request.
+ *
+ * Example:
+ * ```php
+ * setHeader('X-Requested-With', 'Codeception');
+ * $I->amOnPage('test-headers.php');
+ * // ...
+ * $I->deleteHeader('X-Requested-With');
+ * $I->amOnPage('some-other-page.php');
+ * ?>
+ * ```
+ *
+ * @param string $name the name of the header to delete.
+ * @see \Codeception\Module\PhpBrowser::deleteHeader()
+ */
+ public function deleteHeader($name) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('deleteHeader', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Authenticates user for HTTP_AUTH
+ *
+ * @param $username
+ * @param $password
+ * @see \Codeception\Module\PhpBrowser::amHttpAuthenticated()
+ */
+ public function amHttpAuthenticated($username, $password) {
+ return $this->scenario->runStep(new \Codeception\Step\Condition('amHttpAuthenticated', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Opens the page for the given relative URI.
+ *
+ * ``` php
+ * amOnPage('/');
+ * // opens /register page
+ * $I->amOnPage('/register');
+ * ?>
+ * ```
+ *
+ * @param $page
+ * @see \Codeception\Module\PhpBrowser::amOnPage()
+ */
+ public function amOnPage($page) {
+ return $this->scenario->runStep(new \Codeception\Step\Condition('amOnPage', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Open web page at the given absolute URL and sets its hostname as the base host.
+ *
+ * ``` php
+ * amOnUrl('http://codeception.com');
+ * $I->amOnPage('/quickstart'); // moves to http://codeception.com/quickstart
+ * ?>
+ * ```
+ * @see \Codeception\Module\PhpBrowser::amOnUrl()
+ */
+ public function amOnUrl($url) {
+ return $this->scenario->runStep(new \Codeception\Step\Condition('amOnUrl', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Changes the subdomain for the 'url' configuration parameter.
+ * Does not open a page; use `amOnPage` for that.
+ *
+ * ``` php
+ * amOnSubdomain('user');
+ * $I->amOnPage('/');
+ * // moves to http://user.mysite.com/
+ * ?>
+ * ```
+ *
+ * @param $subdomain
+ *
+ * @return mixed
+ * @see \Codeception\Module\PhpBrowser::amOnSubdomain()
+ */
+ public function amOnSubdomain($subdomain) {
+ return $this->scenario->runStep(new \Codeception\Step\Condition('amOnSubdomain', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Low-level API method.
+ * If Codeception commands are not enough, use [Guzzle HTTP Client](http://guzzlephp.org/) methods directly
+ *
+ * Example:
+ *
+ * ``` php
+ * executeInGuzzle(function (\GuzzleHttp\Client $client) {
+ * $client->get('/get', ['query' => ['foo' => 'bar']]);
+ * });
+ * ?>
+ * ```
+ *
+ * It is not recommended to use this command on a regular basis.
+ * If Codeception lacks important Guzzle Client methods, implement them and submit patches.
+ *
+ * @param callable $function
+ * @see \Codeception\Module\PhpBrowser::executeInGuzzle()
+ */
+ public function executeInGuzzle($function) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('executeInGuzzle', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Perform a click on a link or a button, given by a locator.
+ * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
+ * For buttons, the "value" attribute, "name" attribute, and inner text are searched.
+ * For links, the link text is searched.
+ * For images, the "alt" attribute and inner text of any parent links are searched.
+ *
+ * The second parameter is a context (CSS or XPath locator) to narrow the search.
+ *
+ * Note that if the locator matches a button of type `submit`, the form will be submitted.
+ *
+ * ``` php
+ * click('Logout');
+ * // button of form
+ * $I->click('Submit');
+ * // CSS button
+ * $I->click('#form input[type=submit]');
+ * // XPath
+ * $I->click('//form/*[@type=submit]');
+ * // link in context
+ * $I->click('Logout', '#nav');
+ * // using strict locator
+ * $I->click(['link' => 'Login']);
+ * ?>
+ * ```
+ *
+ * @param $link
+ * @param $context
+ * @see \Codeception\Lib\InnerBrowser::click()
+ */
+ public function click($link, $context = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('click', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the current page contains the given string.
+ * Specify a locator as the second parameter to match a specific region.
+ *
+ * ``` php
+ * see('Logout'); // I can suppose user is logged in
+ * $I->see('Sign Up','h1'); // I can suppose it's a signup page
+ * $I->see('Sign Up','//body/h1'); // with XPath
+ * ?>
+ * ```
+ *
+ * @param $text
+ * @param null $selector
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::see()
+ */
+ public function canSee($text, $selector = null) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the current page contains the given string.
+ * Specify a locator as the second parameter to match a specific region.
+ *
+ * ``` php
+ * see('Logout'); // I can suppose user is logged in
+ * $I->see('Sign Up','h1'); // I can suppose it's a signup page
+ * $I->see('Sign Up','//body/h1'); // with XPath
+ * ?>
+ * ```
+ *
+ * @param $text
+ * @param null $selector
+ * @see \Codeception\Lib\InnerBrowser::see()
+ */
+ public function see($text, $selector = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('see', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the current page doesn't contain the text specified.
+ * Give a locator as the second parameter to match a specific region.
+ *
+ * ```php
+ * dontSee('Login'); // I can suppose user is already logged in
+ * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page
+ * $I->dontSee('Sign Up','//body/h1'); // with XPath
+ * ?>
+ * ```
+ *
+ * @param $text
+ * @param null $selector
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::dontSee()
+ */
+ public function cantSee($text, $selector = null) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the current page doesn't contain the text specified.
+ * Give a locator as the second parameter to match a specific region.
+ *
+ * ```php
+ * dontSee('Login'); // I can suppose user is already logged in
+ * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page
+ * $I->dontSee('Sign Up','//body/h1'); // with XPath
+ * ?>
+ * ```
+ *
+ * @param $text
+ * @param null $selector
+ * @see \Codeception\Lib\InnerBrowser::dontSee()
+ */
+ public function dontSee($text, $selector = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSee', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that there's a link with the specified text.
+ * Give a full URL as the second parameter to match links with that exact URL.
+ *
+ * ``` php
+ * seeLink('Logout'); // matches Logout
+ * $I->seeLink('Logout','/logout'); // matches Logout
+ * ?>
+ * ```
+ *
+ * @param $text
+ * @param null $url
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::seeLink()
+ */
+ public function canSeeLink($text, $url = null) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that there's a link with the specified text.
+ * Give a full URL as the second parameter to match links with that exact URL.
+ *
+ * ``` php
+ * seeLink('Logout'); // matches Logout
+ * $I->seeLink('Logout','/logout'); // matches Logout
+ * ?>
+ * ```
+ *
+ * @param $text
+ * @param null $url
+ * @see \Codeception\Lib\InnerBrowser::seeLink()
+ */
+ public function seeLink($text, $url = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the page doesn't contain a link with the given string.
+ * If the second parameter is given, only links with a matching "href" attribute will be checked.
+ *
+ * ``` php
+ * dontSeeLink('Logout'); // I suppose user is not logged in
+ * $I->dontSeeLink('Checkout now', '/store/cart.php');
+ * ?>
+ * ```
+ *
+ * @param $text
+ * @param null $url
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::dontSeeLink()
+ */
+ public function cantSeeLink($text, $url = null) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the page doesn't contain a link with the given string.
+ * If the second parameter is given, only links with a matching "href" attribute will be checked.
+ *
+ * ``` php
+ * dontSeeLink('Logout'); // I suppose user is not logged in
+ * $I->dontSeeLink('Checkout now', '/store/cart.php');
+ * ?>
+ * ```
+ *
+ * @param $text
+ * @param null $url
+ * @see \Codeception\Lib\InnerBrowser::dontSeeLink()
+ */
+ public function dontSeeLink($text, $url = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeLink', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that current URI contains the given string.
+ *
+ * ``` php
+ * seeInCurrentUrl('home');
+ * // to match: /users/1
+ * $I->seeInCurrentUrl('/users/');
+ * ?>
+ * ```
+ *
+ * @param $uri
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl()
+ */
+ public function canSeeInCurrentUrl($uri) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that current URI contains the given string.
+ *
+ * ``` php
+ * seeInCurrentUrl('home');
+ * // to match: /users/1
+ * $I->seeInCurrentUrl('/users/');
+ * ?>
+ * ```
+ *
+ * @param $uri
+ * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl()
+ */
+ public function seeInCurrentUrl($uri) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInCurrentUrl', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the current URI doesn't contain the given string.
+ *
+ * ``` php
+ * dontSeeInCurrentUrl('/users/');
+ * ?>
+ * ```
+ *
+ * @param $uri
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl()
+ */
+ public function cantSeeInCurrentUrl($uri) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the current URI doesn't contain the given string.
+ *
+ * ``` php
+ * dontSeeInCurrentUrl('/users/');
+ * ?>
+ * ```
+ *
+ * @param $uri
+ * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl()
+ */
+ public function dontSeeInCurrentUrl($uri) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInCurrentUrl', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the current URL is equal to the given string.
+ * Unlike `seeInCurrentUrl`, this only matches the full URL.
+ *
+ * ``` php
+ * seeCurrentUrlEquals('/');
+ * ?>
+ * ```
+ *
+ * @param $uri
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals()
+ */
+ public function canSeeCurrentUrlEquals($uri) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the current URL is equal to the given string.
+ * Unlike `seeInCurrentUrl`, this only matches the full URL.
+ *
+ * ``` php
+ * seeCurrentUrlEquals('/');
+ * ?>
+ * ```
+ *
+ * @param $uri
+ * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals()
+ */
+ public function seeCurrentUrlEquals($uri) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCurrentUrlEquals', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the current URL doesn't equal the given string.
+ * Unlike `dontSeeInCurrentUrl`, this only matches the full URL.
+ *
+ * ``` php
+ * dontSeeCurrentUrlEquals('/');
+ * ?>
+ * ```
+ *
+ * @param $uri
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals()
+ */
+ public function cantSeeCurrentUrlEquals($uri) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the current URL doesn't equal the given string.
+ * Unlike `dontSeeInCurrentUrl`, this only matches the full URL.
+ *
+ * ``` php
+ * dontSeeCurrentUrlEquals('/');
+ * ?>
+ * ```
+ *
+ * @param $uri
+ * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals()
+ */
+ public function dontSeeCurrentUrlEquals($uri) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlEquals', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the current URL matches the given regular expression.
+ *
+ * ``` php
+ * seeCurrentUrlMatches('~$/users/(\d+)~');
+ * ?>
+ * ```
+ *
+ * @param $uri
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches()
+ */
+ public function canSeeCurrentUrlMatches($uri) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the current URL matches the given regular expression.
+ *
+ * ``` php
+ * seeCurrentUrlMatches('~$/users/(\d+)~');
+ * ?>
+ * ```
+ *
+ * @param $uri
+ * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches()
+ */
+ public function seeCurrentUrlMatches($uri) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCurrentUrlMatches', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that current url doesn't match the given regular expression.
+ *
+ * ``` php
+ * dontSeeCurrentUrlMatches('~$/users/(\d+)~');
+ * ?>
+ * ```
+ *
+ * @param $uri
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches()
+ */
+ public function cantSeeCurrentUrlMatches($uri) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that current url doesn't match the given regular expression.
+ *
+ * ``` php
+ * dontSeeCurrentUrlMatches('~$/users/(\d+)~');
+ * ?>
+ * ```
+ *
+ * @param $uri
+ * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches()
+ */
+ public function dontSeeCurrentUrlMatches($uri) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlMatches', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Executes the given regular expression against the current URI and returns the first match.
+ * If no parameters are provided, the full URI is returned.
+ *
+ * ``` php
+ * grabFromCurrentUrl('~$/user/(\d+)/~');
+ * $uri = $I->grabFromCurrentUrl();
+ * ?>
+ * ```
+ *
+ * @param null $uri
+ *
+ * @internal param $url
+ * @return mixed
+ * @see \Codeception\Lib\InnerBrowser::grabFromCurrentUrl()
+ */
+ public function grabFromCurrentUrl($uri = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the specified checkbox is checked.
+ *
+ * ``` php
+ * seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms
+ * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form.
+ * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]');
+ * ?>
+ * ```
+ *
+ * @param $checkbox
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked()
+ */
+ public function canSeeCheckboxIsChecked($checkbox) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the specified checkbox is checked.
+ *
+ * ``` php
+ * seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms
+ * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form.
+ * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]');
+ * ?>
+ * ```
+ *
+ * @param $checkbox
+ * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked()
+ */
+ public function seeCheckboxIsChecked($checkbox) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCheckboxIsChecked', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Check that the specified checkbox is unchecked.
+ *
+ * ``` php
+ * dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms
+ * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form.
+ * ?>
+ * ```
+ *
+ * @param $checkbox
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked()
+ */
+ public function cantSeeCheckboxIsChecked($checkbox) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Check that the specified checkbox is unchecked.
+ *
+ * ``` php
+ * dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms
+ * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form.
+ * ?>
+ * ```
+ *
+ * @param $checkbox
+ * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked()
+ */
+ public function dontSeeCheckboxIsChecked($checkbox) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCheckboxIsChecked', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the given input field or textarea contains the given value.
+ * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
+ *
+ * ``` php
+ * seeInField('Body','Type your comment here');
+ * $I->seeInField('form textarea[name=body]','Type your comment here');
+ * $I->seeInField('form input[type=hidden]','hidden_value');
+ * $I->seeInField('#searchform input','Search');
+ * $I->seeInField('//form/*[@name=search]','Search');
+ * $I->seeInField(['name' => 'search'], 'Search');
+ * ?>
+ * ```
+ *
+ * @param $field
+ * @param $value
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::seeInField()
+ */
+ public function canSeeInField($field, $value) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the given input field or textarea contains the given value.
+ * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
+ *
+ * ``` php
+ * seeInField('Body','Type your comment here');
+ * $I->seeInField('form textarea[name=body]','Type your comment here');
+ * $I->seeInField('form input[type=hidden]','hidden_value');
+ * $I->seeInField('#searchform input','Search');
+ * $I->seeInField('//form/*[@name=search]','Search');
+ * $I->seeInField(['name' => 'search'], 'Search');
+ * ?>
+ * ```
+ *
+ * @param $field
+ * @param $value
+ * @see \Codeception\Lib\InnerBrowser::seeInField()
+ */
+ public function seeInField($field, $value) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInField', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that an input field or textarea doesn't contain the given value.
+ * For fuzzy locators, the field is matched by label text, CSS and XPath.
+ *
+ * ``` php
+ * dontSeeInField('Body','Type your comment here');
+ * $I->dontSeeInField('form textarea[name=body]','Type your comment here');
+ * $I->dontSeeInField('form input[type=hidden]','hidden_value');
+ * $I->dontSeeInField('#searchform input','Search');
+ * $I->dontSeeInField('//form/*[@name=search]','Search');
+ * $I->dontSeeInField(['name' => 'search'], 'Search');
+ * ?>
+ * ```
+ *
+ * @param $field
+ * @param $value
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::dontSeeInField()
+ */
+ public function cantSeeInField($field, $value) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that an input field or textarea doesn't contain the given value.
+ * For fuzzy locators, the field is matched by label text, CSS and XPath.
+ *
+ * ``` php
+ * dontSeeInField('Body','Type your comment here');
+ * $I->dontSeeInField('form textarea[name=body]','Type your comment here');
+ * $I->dontSeeInField('form input[type=hidden]','hidden_value');
+ * $I->dontSeeInField('#searchform input','Search');
+ * $I->dontSeeInField('//form/*[@name=search]','Search');
+ * $I->dontSeeInField(['name' => 'search'], 'Search');
+ * ?>
+ * ```
+ *
+ * @param $field
+ * @param $value
+ * @see \Codeception\Lib\InnerBrowser::dontSeeInField()
+ */
+ public function dontSeeInField($field, $value) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInField', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks if the array of form parameters (name => value) are set on the form matched with the
+ * passed selector.
+ *
+ * ``` php
+ * seeInFormFields('form[name=myform]', [
+ * 'input1' => 'value',
+ * 'input2' => 'other value',
+ * ]);
+ * ?>
+ * ```
+ *
+ * For multi-select elements, or to check values of multiple elements with the same name, an
+ * array may be passed:
+ *
+ * ``` php
+ * seeInFormFields('.form-class', [
+ * 'multiselect' => [
+ * 'value1',
+ * 'value2',
+ * ],
+ * 'checkbox[]' => [
+ * 'a checked value',
+ * 'another checked value',
+ * ],
+ * ]);
+ * ?>
+ * ```
+ *
+ * Additionally, checkbox values can be checked with a boolean.
+ *
+ * ``` php
+ * seeInFormFields('#form-id', [
+ * 'checkbox1' => true, // passes if checked
+ * 'checkbox2' => false, // passes if unchecked
+ * ]);
+ * ?>
+ * ```
+ *
+ * Pair this with submitForm for quick testing magic.
+ *
+ * ``` php
+ * 'value',
+ * 'field2' => 'another value',
+ * 'checkbox1' => true,
+ * // ...
+ * ];
+ * $I->submitForm('//form[@id=my-form]', $form, 'submitButton');
+ * // $I->amOnPage('/path/to/form-page') may be needed
+ * $I->seeInFormFields('//form[@id=my-form]', $form);
+ * ?>
+ * ```
+ *
+ * @param $formSelector
+ * @param $params
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::seeInFormFields()
+ */
+ public function canSeeInFormFields($formSelector, $params) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInFormFields', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks if the array of form parameters (name => value) are set on the form matched with the
+ * passed selector.
+ *
+ * ``` php
+ * seeInFormFields('form[name=myform]', [
+ * 'input1' => 'value',
+ * 'input2' => 'other value',
+ * ]);
+ * ?>
+ * ```
+ *
+ * For multi-select elements, or to check values of multiple elements with the same name, an
+ * array may be passed:
+ *
+ * ``` php
+ * seeInFormFields('.form-class', [
+ * 'multiselect' => [
+ * 'value1',
+ * 'value2',
+ * ],
+ * 'checkbox[]' => [
+ * 'a checked value',
+ * 'another checked value',
+ * ],
+ * ]);
+ * ?>
+ * ```
+ *
+ * Additionally, checkbox values can be checked with a boolean.
+ *
+ * ``` php
+ * seeInFormFields('#form-id', [
+ * 'checkbox1' => true, // passes if checked
+ * 'checkbox2' => false, // passes if unchecked
+ * ]);
+ * ?>
+ * ```
+ *
+ * Pair this with submitForm for quick testing magic.
+ *
+ * ``` php
+ * 'value',
+ * 'field2' => 'another value',
+ * 'checkbox1' => true,
+ * // ...
+ * ];
+ * $I->submitForm('//form[@id=my-form]', $form, 'submitButton');
+ * // $I->amOnPage('/path/to/form-page') may be needed
+ * $I->seeInFormFields('//form[@id=my-form]', $form);
+ * ?>
+ * ```
+ *
+ * @param $formSelector
+ * @param $params
+ * @see \Codeception\Lib\InnerBrowser::seeInFormFields()
+ */
+ public function seeInFormFields($formSelector, $params) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInFormFields', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks if the array of form parameters (name => value) are not set on the form matched with
+ * the passed selector.
+ *
+ * ``` php
+ * dontSeeInFormFields('form[name=myform]', [
+ * 'input1' => 'non-existent value',
+ * 'input2' => 'other non-existent value',
+ * ]);
+ * ?>
+ * ```
+ *
+ * To check that an element hasn't been assigned any one of many values, an array can be passed
+ * as the value:
+ *
+ * ``` php
+ * dontSeeInFormFields('.form-class', [
+ * 'fieldName' => [
+ * 'This value shouldn\'t be set',
+ * 'And this value shouldn\'t be set',
+ * ],
+ * ]);
+ * ?>
+ * ```
+ *
+ * Additionally, checkbox values can be checked with a boolean.
+ *
+ * ``` php
+ * dontSeeInFormFields('#form-id', [
+ * 'checkbox1' => true, // fails if checked
+ * 'checkbox2' => false, // fails if unchecked
+ * ]);
+ * ?>
+ * ```
+ *
+ * @param $formSelector
+ * @param $params
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields()
+ */
+ public function cantSeeInFormFields($formSelector, $params) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInFormFields', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks if the array of form parameters (name => value) are not set on the form matched with
+ * the passed selector.
+ *
+ * ``` php
+ * dontSeeInFormFields('form[name=myform]', [
+ * 'input1' => 'non-existent value',
+ * 'input2' => 'other non-existent value',
+ * ]);
+ * ?>
+ * ```
+ *
+ * To check that an element hasn't been assigned any one of many values, an array can be passed
+ * as the value:
+ *
+ * ``` php
+ * dontSeeInFormFields('.form-class', [
+ * 'fieldName' => [
+ * 'This value shouldn\'t be set',
+ * 'And this value shouldn\'t be set',
+ * ],
+ * ]);
+ * ?>
+ * ```
+ *
+ * Additionally, checkbox values can be checked with a boolean.
+ *
+ * ``` php
+ * dontSeeInFormFields('#form-id', [
+ * 'checkbox1' => true, // fails if checked
+ * 'checkbox2' => false, // fails if unchecked
+ * ]);
+ * ?>
+ * ```
+ *
+ * @param $formSelector
+ * @param $params
+ * @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields()
+ */
+ public function dontSeeInFormFields($formSelector, $params) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInFormFields', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Submits the given form on the page, optionally with the given form values.
+ * Give the form fields values as an array.
+ *
+ * Skipped fields will be filled by their values from the page.
+ * You don't need to click the 'Submit' button afterwards.
+ * This command itself triggers the request to form's action.
+ *
+ * You can optionally specify what button's value to include
+ * in the request with the last parameter as an alternative to
+ * explicitly setting its value in the second parameter, as
+ * button values are not otherwise included in the request.
+ *
+ * Examples:
+ *
+ * ``` php
+ * submitForm('#login', array('login' => 'davert', 'password' => '123456'));
+ * // or
+ * $I->submitForm('#login', array('login' => 'davert', 'password' => '123456'), 'submitButtonName');
+ *
+ * ```
+ *
+ * For example, given this sample "Sign Up" form:
+ *
+ * ``` html
+ *
+ * ```
+ *
+ * You could write the following to submit it:
+ *
+ * ``` php
+ * submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true)), 'submitButton');
+ *
+ * ```
+ * Note that "2" will be the submitted value for the "plan" field, as it is the selected option.
+ *
+ * You can also emulate a JavaScript submission by not specifying any buttons in the third parameter to submitForm.
+ *
+ * ```php
+ * submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true)));
+ *
+ * ```
+ *
+ * Pair this with seeInFormFields for quick testing magic.
+ *
+ * ``` php
+ * 'value',
+ * 'field2' => 'another value',
+ * 'checkbox1' => true,
+ * // ...
+ * ];
+ * $I->submitForm('//form[@id=my-form]', $form, 'submitButton');
+ * // $I->amOnPage('/path/to/form-page') may be needed
+ * $I->seeInFormFields('//form[@id=my-form]', $form);
+ * ?>
+ * ```
+ *
+ * Parameter values can be set to arrays for multiple input fields
+ * of the same name, or multi-select combo boxes. For checkboxes,
+ * either the string value can be used, or boolean values which will
+ * be replaced by the checkbox's value in the DOM.
+ *
+ * ``` php
+ * submitForm('#my-form', [
+ * 'field1' => 'value',
+ * 'checkbox' => [
+ * 'value of first checkbox',
+ * 'value of second checkbox,
+ * ],
+ * 'otherCheckboxes' => [
+ * true,
+ * false,
+ * false
+ * ],
+ * 'multiselect' => [
+ * 'first option value',
+ * 'second option value'
+ * ]
+ * ]);
+ * ?>
+ * ```
+ *
+ * Mixing string and boolean values for a checkbox's value is not
+ * supported and may produce unexpected results.
+ *
+ * @param $selector
+ * @param $params
+ * @param $button
+ * @see \Codeception\Lib\InnerBrowser::submitForm()
+ */
+ public function submitForm($selector, $params, $button = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('submitForm', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Fills a text field or textarea with the given string.
+ *
+ * ``` php
+ * fillField("//input[@type='text']", "Hello World!");
+ * $I->fillField(['name' => 'email'], 'jon@mail.com');
+ * ?>
+ * ```
+ *
+ * @param $field
+ * @param $value
+ * @see \Codeception\Lib\InnerBrowser::fillField()
+ */
+ public function fillField($field, $value) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('fillField', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Selects an option in a select tag or in radio button group.
+ *
+ * ``` php
+ * selectOption('form select[name=account]', 'Premium');
+ * $I->selectOption('form input[name=payment]', 'Monthly');
+ * $I->selectOption('//form/select[@name=account]', 'Monthly');
+ * ?>
+ * ```
+ *
+ * Provide an array for the second argument to select multiple options:
+ *
+ * ``` php
+ * selectOption('Which OS do you use?', array('Windows','Linux'));
+ * ?>
+ * ```
+ *
+ * @param $select
+ * @param $option
+ * @see \Codeception\Lib\InnerBrowser::selectOption()
+ */
+ public function selectOption($select, $option) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('selectOption', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Ticks a checkbox. For radio buttons, use the `selectOption` method instead.
+ *
+ * ``` php
+ * checkOption('#agree');
+ * ?>
+ * ```
+ *
+ * @param $option
+ * @see \Codeception\Lib\InnerBrowser::checkOption()
+ */
+ public function checkOption($option) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('checkOption', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Unticks a checkbox.
+ *
+ * ``` php
+ * uncheckOption('#notify');
+ * ?>
+ * ```
+ *
+ * @param $option
+ * @see \Codeception\Lib\InnerBrowser::uncheckOption()
+ */
+ public function uncheckOption($option) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('uncheckOption', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Attaches a file relative to the Codeception data directory to the given file upload field.
+ *
+ * ``` php
+ * attachFile('input[@type="file"]', 'prices.xls');
+ * ?>
+ * ```
+ *
+ * @param $field
+ * @param $filename
+ * @see \Codeception\Lib\InnerBrowser::attachFile()
+ */
+ public function attachFile($field, $filename) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('attachFile', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * If your page triggers an ajax request, you can perform it manually.
+ * This action sends a GET ajax request with specified params.
+ *
+ * See ->sendAjaxPostRequest for examples.
+ *
+ * @param $uri
+ * @param $params
+ * @see \Codeception\Lib\InnerBrowser::sendAjaxGetRequest()
+ */
+ public function sendAjaxGetRequest($uri, $params = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxGetRequest', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * If your page triggers an ajax request, you can perform it manually.
+ * This action sends a POST ajax request with specified params.
+ * Additional params can be passed as array.
+ *
+ * Example:
+ *
+ * Imagine that by clicking checkbox you trigger ajax request which updates user settings.
+ * We emulate that click by running this ajax request manually.
+ *
+ * ``` php
+ * sendAjaxPostRequest('/updateSettings', array('notifications' => true)); // POST
+ * $I->sendAjaxGetRequest('/updateSettings', array('notifications' => true)); // GET
+ *
+ * ```
+ *
+ * @param $uri
+ * @param $params
+ * @see \Codeception\Lib\InnerBrowser::sendAjaxPostRequest()
+ */
+ public function sendAjaxPostRequest($uri, $params = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxPostRequest', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * If your page triggers an ajax request, you can perform it manually.
+ * This action sends an ajax request with specified method and params.
+ *
+ * Example:
+ *
+ * You need to perform an ajax request specifying the HTTP method.
+ *
+ * ``` php
+ * sendAjaxRequest('PUT', '/posts/7', array('title' => 'new title'));
+ *
+ * ```
+ *
+ * @param $method
+ * @param $uri
+ * @param $params
+ * @see \Codeception\Lib\InnerBrowser::sendAjaxRequest()
+ */
+ public function sendAjaxRequest($method, $uri, $params = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxRequest', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Finds and returns the text contents of the given element.
+ * If a fuzzy locator is used, the element is found using CSS, XPath, and by matching the full page source by regular expression.
+ *
+ * ``` php
+ * grabTextFrom('h1');
+ * $heading = $I->grabTextFrom('descendant-or-self::h1');
+ * $value = $I->grabTextFrom('~
+ * ```
+ *
+ * @param $cssOrXPathOrRegex
+ *
+ * @return mixed
+ * @see \Codeception\Lib\InnerBrowser::grabTextFrom()
+ */
+ public function grabTextFrom($cssOrXPathOrRegex) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('grabTextFrom', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Grabs the value of the given attribute value from the given element.
+ * Fails if element is not found.
+ *
+ * ``` php
+ * grabAttributeFrom('#tooltip', 'title');
+ * ?>
+ * ```
+ *
+ *
+ * @param $cssOrXpath
+ * @param $attribute
+ * @internal param $element
+ * @return mixed
+ * @see \Codeception\Lib\InnerBrowser::grabAttributeFrom()
+ */
+ public function grabAttributeFrom($cssOrXpath, $attribute) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('grabAttributeFrom', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * @param $field
+ *
+ * @return array|mixed|null|string
+ * @see \Codeception\Lib\InnerBrowser::grabValueFrom()
+ */
+ public function grabValueFrom($field) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('grabValueFrom', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Sets a cookie with the given name and value.
+ * You can set additional cookie params like `domain`, `path`, `expire`, `secure` in array passed as last argument.
+ *
+ * ``` php
+ * setCookie('PHPSESSID', 'el4ukv0kqbvoirg7nkp4dncpk3');
+ * ?>
+ * ```
+ *
+ * @param $name
+ * @param $val
+ * @param array $params
+ * @internal param $cookie
+ * @internal param $value
+ *
+ * @return mixed
+ * @see \Codeception\Lib\InnerBrowser::setCookie()
+ */
+ public function setCookie($name, $val, $params = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('setCookie', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Grabs a cookie value.
+ * You can set additional cookie params like `domain`, `path` in array passed as last argument.
+ *
+ * @param $cookie
+ *
+ * @param array $params
+ * @return mixed
+ * @see \Codeception\Lib\InnerBrowser::grabCookie()
+ */
+ public function grabCookie($name, $params = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('grabCookie', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that a cookie with the given name is set.
+ * You can set additional cookie params like `domain`, `path` as array passed in last argument.
+ *
+ * ``` php
+ * seeCookie('PHPSESSID');
+ * ?>
+ * ```
+ *
+ * @param $cookie
+ * @param array $params
+ * @return mixed
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::seeCookie()
+ */
+ public function canSeeCookie($name, $params = null) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that a cookie with the given name is set.
+ * You can set additional cookie params like `domain`, `path` as array passed in last argument.
+ *
+ * ``` php
+ * seeCookie('PHPSESSID');
+ * ?>
+ * ```
+ *
+ * @param $cookie
+ * @param array $params
+ * @return mixed
+ * @see \Codeception\Lib\InnerBrowser::seeCookie()
+ */
+ public function seeCookie($name, $params = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that there isn't a cookie with the given name.
+ * You can set additional cookie params like `domain`, `path` as array passed in last argument.
+ *
+ * @param $cookie
+ *
+ * @param array $params
+ * @return mixed
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::dontSeeCookie()
+ */
+ public function cantSeeCookie($name, $params = null) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that there isn't a cookie with the given name.
+ * You can set additional cookie params like `domain`, `path` as array passed in last argument.
+ *
+ * @param $cookie
+ *
+ * @param array $params
+ * @return mixed
+ * @see \Codeception\Lib\InnerBrowser::dontSeeCookie()
+ */
+ public function dontSeeCookie($name, $params = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCookie', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Unsets cookie with the given name.
+ * You can set additional cookie params like `domain`, `path` in array passed as last argument.
+ *
+ * @param $cookie
+ *
+ * @param array $params
+ * @return mixed
+ * @see \Codeception\Lib\InnerBrowser::resetCookie()
+ */
+ public function resetCookie($name, $params = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('resetCookie', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the given element exists on the page and is visible.
+ * You can also specify expected attributes of this element.
+ *
+ * ``` php
+ * seeElement('.error');
+ * $I->seeElement('//form/input[1]');
+ * $I->seeElement('input', ['name' => 'login']);
+ * $I->seeElement('input', ['value' => '123456']);
+ *
+ * // strict locator in first arg, attributes in second
+ * $I->seeElement(['css' => 'form input'], ['name' => 'login']);
+ * ?>
+ * ```
+ *
+ * @param $selector
+ * @param array $attributes
+ * @return
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::seeElement()
+ */
+ public function canSeeElement($selector, $attributes = null) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the given element exists on the page and is visible.
+ * You can also specify expected attributes of this element.
+ *
+ * ``` php
+ * seeElement('.error');
+ * $I->seeElement('//form/input[1]');
+ * $I->seeElement('input', ['name' => 'login']);
+ * $I->seeElement('input', ['value' => '123456']);
+ *
+ * // strict locator in first arg, attributes in second
+ * $I->seeElement(['css' => 'form input'], ['name' => 'login']);
+ * ?>
+ * ```
+ *
+ * @param $selector
+ * @param array $attributes
+ * @return
+ * @see \Codeception\Lib\InnerBrowser::seeElement()
+ */
+ public function seeElement($selector, $attributes = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the given element is invisible or not present on the page.
+ * You can also specify expected attributes of this element.
+ *
+ * ``` php
+ * dontSeeElement('.error');
+ * $I->dontSeeElement('//form/input[1]');
+ * $I->dontSeeElement('input', ['name' => 'login']);
+ * $I->dontSeeElement('input', ['value' => '123456']);
+ * ?>
+ * ```
+ *
+ * @param $selector
+ * @param array $attributes
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::dontSeeElement()
+ */
+ public function cantSeeElement($selector, $attributes = null) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the given element is invisible or not present on the page.
+ * You can also specify expected attributes of this element.
+ *
+ * ``` php
+ * dontSeeElement('.error');
+ * $I->dontSeeElement('//form/input[1]');
+ * $I->dontSeeElement('input', ['name' => 'login']);
+ * $I->dontSeeElement('input', ['value' => '123456']);
+ * ?>
+ * ```
+ *
+ * @param $selector
+ * @param array $attributes
+ * @see \Codeception\Lib\InnerBrowser::dontSeeElement()
+ */
+ public function dontSeeElement($selector, $attributes = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeElement', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that there are a certain number of elements matched by the given locator on the page.
+ *
+ * ``` php
+ * seeNumberOfElements('tr', 10);
+ * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements
+ * ?>
+ * ```
+ * @param $selector
+ * @param mixed $expected:
+ * - string: strict number
+ * - array: range of numbers [0,10]
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements()
+ */
+ public function canSeeNumberOfElements($selector, $expected) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElements', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that there are a certain number of elements matched by the given locator on the page.
+ *
+ * ``` php
+ * seeNumberOfElements('tr', 10);
+ * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements
+ * ?>
+ * ```
+ * @param $selector
+ * @param mixed $expected:
+ * - string: strict number
+ * - array: range of numbers [0,10]
+ * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements()
+ */
+ public function seeNumberOfElements($selector, $expected) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('seeNumberOfElements', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the given option is selected.
+ *
+ * ``` php
+ * seeOptionIsSelected('#form input[name=payment]', 'Visa');
+ * ?>
+ * ```
+ *
+ * @param $selector
+ * @param $optionText
+ *
+ * @return mixed
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected()
+ */
+ public function canSeeOptionIsSelected($select, $optionText) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the given option is selected.
+ *
+ * ``` php
+ * seeOptionIsSelected('#form input[name=payment]', 'Visa');
+ * ?>
+ * ```
+ *
+ * @param $selector
+ * @param $optionText
+ *
+ * @return mixed
+ * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected()
+ */
+ public function seeOptionIsSelected($select, $optionText) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the given option is not selected.
+ *
+ * ``` php
+ * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
+ * ?>
+ * ```
+ *
+ * @param $selector
+ * @param $optionText
+ *
+ * @return mixed
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected()
+ */
+ public function cantSeeOptionIsSelected($select, $optionText) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the given option is not selected.
+ *
+ * ``` php
+ * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
+ * ?>
+ * ```
+ *
+ * @param $selector
+ * @param $optionText
+ *
+ * @return mixed
+ * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected()
+ */
+ public function dontSeeOptionIsSelected($select, $optionText) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeOptionIsSelected', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Asserts that current page has 404 response status code.
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::seePageNotFound()
+ */
+ public function canSeePageNotFound() {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seePageNotFound', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Asserts that current page has 404 response status code.
+ * @see \Codeception\Lib\InnerBrowser::seePageNotFound()
+ */
+ public function seePageNotFound() {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('seePageNotFound', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that response code is equal to value provided.
+ *
+ * @param $code
+ *
+ * @return mixed
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs()
+ */
+ public function canSeeResponseCodeIs($code) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIs', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that response code is equal to value provided.
+ *
+ * @param $code
+ *
+ * @return mixed
+ * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs()
+ */
+ public function seeResponseCodeIs($code) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('seeResponseCodeIs', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the page title contains the given string.
+ *
+ * ``` php
+ * seeInTitle('Blog - Post #1');
+ * ?>
+ * ```
+ *
+ * @param $title
+ *
+ * @return mixed
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::seeInTitle()
+ */
+ public function canSeeInTitle($title) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInTitle', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the page title contains the given string.
+ *
+ * ``` php
+ * seeInTitle('Blog - Post #1');
+ * ?>
+ * ```
+ *
+ * @param $title
+ *
+ * @return mixed
+ * @see \Codeception\Lib\InnerBrowser::seeInTitle()
+ */
+ public function seeInTitle($title) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInTitle', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the page title does not contain the given string.
+ *
+ * @param $title
+ *
+ * @return mixed
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle()
+ */
+ public function cantSeeInTitle($title) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInTitle', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks that the page title does not contain the given string.
+ *
+ * @param $title
+ *
+ * @return mixed
+ * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle()
+ */
+ public function dontSeeInTitle($title) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInTitle', func_get_args()));
+ }
+}
diff --git a/tests/acceptance/_bootstrap.php b/tests/acceptance/_bootstrap.php
new file mode 100644
index 000000000..8a8855580
--- /dev/null
+++ b/tests/acceptance/_bootstrap.php
@@ -0,0 +1,2 @@
+ */
-
-if(!defined('FOLLOW_REQUEST_SSL')) define('FOLLOW_REQUEST_SSL',0);
-if(!defined('ENFORCE_SSL')) define('ENFORCE_SSL',1);
-if(!defined('RELEASE_SSL')) define('RELEASE_SSL',2);
-if(!defined('MOCK_CONTEXT')) define('MOCK_CONTEXT', 1);
-
-class Context
-{
- public static $mock_vars = array();
- private static $useCdn = 'N';
- private static $requestUrl = 'http://www.test.com';
-
- public function gets() {
- $args = func_get_args();
- $output = new stdClass;
-
- foreach($args as $name) {
- $output->{$name} = self::$mock_vars[$name];
- }
-
- return $output;
- }
-
- public function get($name) {
- return array_key_exists($name, self::$mock_vars)?self::$mock_vars[$name]:'';
- }
-
- public function getRequestVars() {
- return self::$mock_vars;
- }
-
- public function set($name, $value) {
- self::$mock_vars[$name] = $value;
- }
-
- public function getLangType() {
- return 'en';
- }
-
- public function getLang($str) {
- return $str;
- }
-
- public function truncate() {
- self::$mock_vars = array();
- }
-
- public static function setUseCdn($useCdn)
- {
- self::$useCdn = $useCdn != 'Y' ? 'N':'Y';
- }
-
- public static function getDBInfo() {
- $dbInfo = new stdClass();
- $dbInfo->use_cdn = self::$useCdn;
-
- return $dbInfo;
- }
-
-
- public static function setRequestUrl($url)
- {
- self::$requestUrl= $url;
- }
-
- public static function getRequestUrl() {
- return self::$requestUrl;
- }
-}
-
-/* End of file Context.mock.php */
-/* Location: ./tests/classes/context/Context.mock.php */
diff --git a/tests/classes/context/ContextTest.php b/tests/classes/context/ContextTest.php
deleted file mode 100644
index d4551b4d6..000000000
--- a/tests/classes/context/ContextTest.php
+++ /dev/null
@@ -1,86 +0,0 @@
- */
-
-if(!defined('__XE__')) require dirname(__FILE__).'/../../Bootstrap.php';
-
-require_once _XE_PATH_.'classes/context/Context.class.php';
-require_once _XE_PATH_.'classes/handler/Handler.class.php';
-require_once _XE_PATH_.'classes/frontendfile/FrontEndFileHandler.class.php';
-
-class ContextTest extends PHPUnit_Framework_TestCase
-{
- /**
- * test whether the singleton works
- */
- public function testGetInstance()
- {
- $this->assertInstanceOf('Context', Context::getInstance());
- $this->assertSame(Context::getInstance(), Context::getInstance());
- }
-
- public function testSetGetVars()
- {
- $this->assertSame(Context::get('var1'), null);
- Context::set('var1', 'val1');
- $this->assertSame(Context::get('var1'), 'val1');
-
- Context::set('var2', 'val2');
- $this->assertSame(Context::get('var2'), 'val2');
- Context::set('var3', 'val3');
- $data = new stdClass;
- $data->var1 = 'val1';
- $data->var2 = 'val2';
- $this->assertEquals(Context::gets('var1','var2'), $data);
- $data->var3 = 'val3';
- $this->assertEquals(Context::getAll(), $data);
- }
-
- public function testAddGetBodyClass()
- {
- $this->assertEquals(Context::getBodyClass(), '');
- Context::addBodyClass('red');
- $this->assertEquals(Context::getBodyClass(), ' class="red"');
- Context::addBodyClass('green');
- $this->assertEquals(Context::getBodyClass(), ' class="red green"');
- Context::addBodyClass('blue');
- $this->assertEquals(Context::getBodyClass(), ' class="red green blue"');
-
- // remove duplicated class
- Context::addBodyClass('red');
- $this->assertEquals(Context::getBodyClass(), ' class="red green blue"');
- }
-
- public function testRequsetResponseMethod()
- {
- $this->assertEquals(Context::getRequestMethod(), 'GET');
-
- $_SERVER['REQUEST_METHOD'] = 'POST';
- Context::setRequestMethod();
- $this->assertEquals(Context::getRequestMethod(), 'POST');
-
- $GLOBALS['HTTP_RAW_POST_DATA'] = 'abcde';
- Context::setRequestMethod();
- $this->assertEquals(Context::getRequestMethod(), 'XMLRPC');
-
- $_SERVER['CONTENT_TYPE'] = 'application/json';
- Context::setRequestMethod();
- $this->assertEquals(Context::getRequestMethod(), 'JSON');
-
- Context::setRequestMethod('POST');
- $this->assertEquals(Context::getRequestMethod(), 'POST');
-
- $this->assertEquals(Context::getResponseMethod(), 'HTML');
- Context::setRequestMethod('JSON');
- $this->assertEquals(Context::getResponseMethod(), 'JSON');
-
- Context::setResponseMethod('WRONG_TYPE');
- $this->assertEquals(Context::getResponseMethod(), 'HTML');
- Context::setResponseMethod('XMLRPC');
- $this->assertEquals(Context::getResponseMethod(), 'XMLRPC');
- Context::setResponseMethod('HTML');
- $this->assertEquals(Context::getResponseMethod(), 'HTML');
- }
-}
-
-/* End of file ContextTest.php */
-/* Location: ./tests/classes/context/ContextTest.php */
diff --git a/tests/classes/db/Helper.class.php b/tests/classes/db/Helper.class.php
deleted file mode 100644
index e3aa4ad02..000000000
--- a/tests/classes/db/Helper.class.php
+++ /dev/null
@@ -1,24 +0,0 @@
- */
-
- class Helper {
- static function cleanString($query){
- $query = trim(preg_replace('/\s+/', ' ',$query));
- $query = preg_replace('/\t+/', '',$query);
- $query = str_replace(" , ", ', ', $query);
- $query = str_replace(" ,", ',', $query);
- $query = str_replace("( ", '(', $query);
- $query = str_replace(" )", ')', $query);
- $query = str_replace(array("\r", "\r\n", "\n"), '*', $query);
- $query = strtolower($query);
- return $query;
- }
-
- static function getXmlObject($xml_file){
- $xmlParser = XmlQueryParser::getInstance();
- return $xmlParser->getXmlFileContent($xml_file);
- }
-
- }
-
-?>
diff --git a/tests/classes/db/QueryTester.class.php b/tests/classes/db/QueryTester.class.php
deleted file mode 100644
index f827529da..000000000
--- a/tests/classes/db/QueryTester.class.php
+++ /dev/null
@@ -1,321 +0,0 @@
- */
-
-// Only supports queries inside modules for now
-
- class QueryTester {
-
- function QueryTester(){
-
- }
-
- function getQueryPath($type, $name, $query_name){
- return _XE_PATH_ . $type ."/".$name."/queries/" . $query_name . ".xml";
- }
-
- function getNewParserOutput($xml_file){
- $newXmlQueryParser = new XmlQueryParser();
- $xml_obj = $newXmlQueryParser->getXmlFileContent($xml_file);
- $parser = new QueryParser($xml_obj->query);
- return $parser->toString();
- }
-
- function getOldParserOutput($query_id, $xml_file){
- $cache_file = _TEST_PATH_ . "cache/".$query_id.'.cache.php';
- $parser = new OldXmlQueryParser();
- $parser->parse($query_id, $xml_file, $cache_file);
- $buff = FileHandler::readFile($cache_file);
- return $buff;
- }
-
- function cleanOutputAndAddArgs($outputString, $argsString = ''){
- $outputString = str_replace("", "", $outputString);
- $outputString = $argsString . $outputString;
- return $outputString;
- }
-
- function getXmlFileContent($xml_file){
- return FileHandler::readFile($xml_file);
- }
-
- function printOutput($output){
- if(is_object($output)) {
- var_dump($output); return;
- }
- $output = htmlspecialchars($output, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
-
- $output = preg_replace('/select/i', 'SELECT', $output);
- $output = preg_replace('/from/i', '
FROM', $output);
- $output = preg_replace('/where/i', '
WHERE', $output);
- $output = preg_replace('/group by/i', '
GROUP BY', $output);
- $output = preg_replace('/order by/i', '
ORDER BY', $output);
-
- $output = str_replace("\n", "
", $output);
-
- echo ''
- .$output
- .'
';
- }
-
- function getNewParserOutputString($xml_file, $argsString){
- $outputString = '';
- $outputString = $this->getNewParserOutput($xml_file);
- $outputString = $this->cleanOutputAndAddArgs($outputString, $argsString);
- return $outputString;
- }
-
- function getNewParserQuery($outputString){
- //echo $outputString;
- //exit(0);
- $output = eval($outputString);
- if(is_a($output, 'Object'))
- if(!$output->toBool()) return("Date incorecte! Query-ul nu a putut fi executat.");
- $db = new DBCubrid();
- if($output->getAction() == 'select')
- return $db->getSelectSql($output);
- else if($output->getAction() == 'insert')
- return $db->getInsertSql($output);
- else if($output->getAction() == 'update')
- return $db->getUpdateSql($output);
- else if($output->getAction() == 'delete')
- return $db->getDeleteSql($output);
- }
-
- function testNewParser($xml_file, $escape_char, $argsString, $show_output_string){
- $outputString = $this->getNewParserOutputString($xml_file, $escape_char, $argsString);
- $query = $this->getNewParserQuery($outputString);
-
- echo '';
- if($show_output_string){
- echo '| ';
- $this->printOutput($outputString);
- echo ' | ';
- }
-
- echo '';
- $this->printOutput($query);
- echo ' | ';
- echo '
';
- }
-
- function getOldParserOutputString($query_id, $xml_file, $argsString){
- $outputString = $this->getOldParserOutput($query_id, $xml_file);
- $outputString = $this->cleanOutputAndAddArgs($outputString, $argsString);
- return $outputString;
- }
-
- function getOldParserQuery($outputString){
- $output = eval($outputString);
- if(is_a($output, 'Object'))
- if(!$output->toBool()) exit("Date incorecte! Query-ul nu a putut fi executat.");
-
- /* SQL Server
- *
- $db = new DBMssql(false);
- if($output->action == "select")
- return $db->_executeSelectAct($output);
- else if($output->action == "insert")
- return $db->_executeInsertAct($output);
- else if($output->action == "delete")
- return $db->_executeDeleteAct($output);
- else if($output->action == "update")
- return $db->_executeUpdateAct($output);
- */
-
- /*
- * Mysql
- */
- $db = new DBMysql(false);
- if($output->action == "select")
- $db->_executeSelectAct($output);
- else if($output->action == "insert")
- $db->_executeInsertAct($output);
- else if($output->action == "delete")
- $db->_executeDeleteAct($output);
- else if($output->action == "update")
- $db->_executeUpdateAct($output);
- return $db->getLatestQuery();
- }
-
- function testOldParser($query_id, $xml_file, $argsString, $show_output_string){
- $outputString = $this->getOldParserOutputString($query_id, $xml_file, $argsString);
- $query = $this->getOldParserQuery($outputString);
-
-
- echo '';
- if($show_output_string){
- echo '| ';
- $this->printOutput($outputString);
- echo ' | ';
- }
-
- echo '';
- $this->printOutput($query);
- echo ' | ';
- echo '
';
- }
-
- function showXmlInputFile($xml_file){
- echo '';
- echo '| ';
- $xml_file_content = $this->getXmlFileContent($xml_file);
- $this->printOutput($xml_file_content);
- echo ' |
';
- }
-
- function test($query_id, $xml_file, $argsString, $show_output_string, $escape_char = '"'){
- echo "$query_id
";
- echo '';
-
- $this->showXmlInputFile($xml_file);
-
- $this->testNewParser($xml_file, $escape_char, $argsString, $show_output_string);
-
- //$this->testOldParser($query_id, $xml_file, $argsString, $show_output_string);
-
- echo '
';
- }
-
- function test_addon_getAddonInfo($show_output_string = false){
- $argsString = '$args->addon = "captcha";';
- $this->test("modules.addon.getAddonInfo"
- , $this->getQueryPath("modules", "addon", "getAddonInfo")
- , $argsString
- , $show_output_string);
- }
-
- function test_addon_getAddons($show_output_string = false){
- $argsString = '';
- $this->test("modules.addon.getAddons"
- , $this->getQueryPath("modules", "addon", "getAddons")
- , $argsString
- , $show_output_string);
- }
-
- function test_admin_getCommentCount($show_output_string = false){
- $argsString = '';
- $this->test("modules.admin.getCommentCount"
- , $this->getQueryPath("modules", "admin", "getCommentCount")
- , $argsString
- , $show_output_string);
- }
-
- function test_admin_getCommentDeclaredStatus($show_output_string = false){
- $argsString = '$args->date = "20110411";';
- $this->test("modules.admin.getCommentDeclaredStatus"
- , $this->getQueryPath("modules", "admin", "getCommentDeclaredStatus")
- , $argsString
- , $show_output_string);
- }
-
- function test_module_getDefaultModules($show_output_string = false){
- $argsString = '';
- $this->test("modules.module.getDefaultModules"
- , $this->getQueryPath("modules", "module", "getDefaultModules")
- , $argsString
- , $show_output_string);
- }
-
- function test_module_getModuleCategories($show_output_string = false){
- $argsString = '';
- $this->test("modules.module.getModuleCategories"
- , $this->getQueryPath("modules", "module", "getModuleCategories")
- , $argsString
- , $show_output_string);
- }
-
- function test_module_getNonuniqueDomains($show_output_string = false){
- $argsString = '';
- $this->test("modules.module.getNonuniqueDomains"
- , $this->getQueryPath("modules", "module", "getNonuniqueDomains")
- , $argsString
- , $show_output_string);
- }
-
- function test_module_getAdminId($show_output_string = false){
- $argsString = '$args->module_srl = 23;';
- $this->test("modules.module.getAdminId"
- , $this->getQueryPath("modules", "module", "getAdminId")
- , $argsString
- , $show_output_string);
- }
- function test_module_getSiteInfo($show_output_string = false){
- $argsString = '$args->site_srl = 0;';
- $this->test("modules.module.getSiteInfo"
- , $this->getQueryPath("modules", "module", "getSiteInfo")
- , $argsString
- , $show_output_string);
- }
- function test_module_insertModule($show_output_string = false){
- $argsString = ' $args->module_category_srl = 0;
- $args->browser_title = "test";
- $args->layout_srl = 0;
- $args->mlayout_srl = 0;
- $args->module = "page";
- $args->mid = "test";
- $args->site_srl = 0;
- $args->module_srl = 47374;';
- $this->test("modules.module.insertModule"
- , $this->getQueryPath("modules", "module", "insertModule")
- , $argsString
- , $show_output_string);
- }
- function test_module_updateModule($show_output_string = false){
- $argsString = ' $args->module_category_srl = 0;
- $args->browser_title = "test";
- $args->layout_srl = 0;
- $args->mlayout_srl = 0;
- $args->module = "page";
- $args->mid = "test";
- $args->use_mobile = "";
- $args->site_srl = 0;
- $args->module_srl = 47374;';
- $this->test("modules.module.updateModule"
- , $this->getQueryPath("modules", "module", "updateModule")
- , $argsString
- , $show_output_string);
- }
- function test_admin_deleteActionForward($show_output_string = false){
- $argsString = '$args->module = "page";
- $args->type = "page";
- $args->act = "tata";';
- $this->test("modules.admin.deleteActionForward"
- , $this->getQueryPath("modules", "module", "deleteActionForward")
- , $argsString
- , $show_output_string);
- }
-
- function test_member_getAutologin($show_output_string = false){
- $argsString = '$args->autologin_key = 10;';
- $this->test("modules.member.getAutologin"
- , $this->getQueryPath("modules", "member", "getAutologin")
- , $argsString
- , $show_output_string);
- }
-
- function test_opage_getOpageList($show_output_string = false){
- $argsString = '$args->s_title = "yuhuu";
- $args->module = 12;';
- $this->test("modules.opage.getOpageList"
- , $this->getQueryPath("modules", "opage", "getOpageList")
- , $argsString
- , $show_output_string);
- }
- function test_getPageList($show_output_string = false){
- $argsString = '$args->sort_index = "module_srl";
- $args->page_count = 10;
- $args->s_module_category_srl = 0;
- $args->s_mid = "test";
- $args->s_browser_title = "caca";';
-
- $this->test("modules.page.getPageList"
- , $this->getQueryPath("modules", "page", "getPageList")
- , $argsString
- , $show_output_string);
- }
-
-
-
- }
-?>
diff --git a/tests/classes/db/classes/db/queryparts/condition/ConditionWithArgumentTest.php b/tests/classes/db/classes/db/queryparts/condition/ConditionWithArgumentTest.php
deleted file mode 100644
index 4b99ab824..000000000
--- a/tests/classes/db/classes/db/queryparts/condition/ConditionWithArgumentTest.php
+++ /dev/null
@@ -1,93 +0,0 @@
- */
-
-/**
- * Test class for ConditionWithArgument.
- */
-class ConditionWithArgumentTest extends CubridTest {
-
- /**
- * Checks equal operation
- */
- public function testConditionString_Equal_WithoutPipe_NumericValue() {
- $member_srl_argument = new ConditionArgument('"member_srl"', 20, 'equal');
-
- $tag = new ConditionWithArgument('"member_srl"', $member_srl_argument, 'equal', null);
-
- $this->assertEquals(' "member_srl" = 20', $tag->toString());
- }
-
- /**
- * Checks equal operation
- */
- public function testConditionString_Equal_WithPipe_NumericValue() {
- $member_srl_argument = new ConditionArgument('"member_srl"', 20, 'equal');
-
- $tag = new ConditionWithArgument('"member_srl"', $member_srl_argument, 'equal', 'and');
-
- $this->assertEquals('and "member_srl" = 20', $tag->toString());
- }
-
- /**
- * Checks condition returns nothing when argument is not valid
- */
- public function testConditionString_InvalidArgument() {
- $member_srl_argument = new ConditionArgument('"member_srl"', null, 'equal');
- $member_srl_argument->checkNotNull();
-
- $tag = new ConditionWithArgument('"member_srl"', $member_srl_argument, 'equal', 'and');
-
- $this->assertEquals('', $tag->toString());
- }
-
- /**
- * Checks "in" operation
- */
- public function testConditionString_In_VarcharArray() {
- $member_srl_argument = new ConditionArgument('"member_srl"', array('a', 'b', 'c'), 'in');
- $member_srl_argument->createConditionValue();
- $member_srl_argument->setColumnType('varchar');
-
- $tag = new ConditionWithArgument('"member_srl"', $member_srl_argument, 'in');
-
- $this->assertEquals(' "member_srl" in (\'a\',\'b\',\'c\')', $tag->toString());
- }
-
- /**
- * Checks and operation
- */
- public function testConditionString_And() {
- $tag = new ConditionWithoutArgument('"member_srl"', "20", 'and', null);
-
- $this->assertEquals(' "member_srl" & 20', $tag->toString());
- }
-
- /**
- * Checks or operation
- */
- public function testConditionString_Or() {
- $tag = new ConditionWithoutArgument('"member_srl"', "20", 'or', null);
-
- $this->assertEquals(' "member_srl" | 20', $tag->toString());
- }
-
- /**
- * Checks xor operation
- */
- public function testConditionString_Xor() {
- $tag = new ConditionWithoutArgument('"member_srl"', "20", 'xor', null);
-
- $this->assertEquals(' "member_srl" ^ 20', $tag->toString());
- }
-
- /**
- * Checks not operation
- */
- public function testConditionString_Not() {
- $tag = new ConditionWithoutArgument('"member_srl"', "20", 'not', null);
-
- $this->assertEquals(' "member_srl" ~ 20', $tag->toString());
- }
-}
-
-?>
diff --git a/tests/classes/db/classes/db/queryparts/table/TableTest.php b/tests/classes/db/classes/db/queryparts/table/TableTest.php
deleted file mode 100644
index 96ef0f230..000000000
--- a/tests/classes/db/classes/db/queryparts/table/TableTest.php
+++ /dev/null
@@ -1,43 +0,0 @@
- */
-
- /**
- * Test class for Table.
- */
-class TableTest extends CubridTest
-{
- /**
- * @var Table
- */
- protected $object;
-
- protected function setUp()
- {
- $this->object = new Table('"xe_member"', '"m"');
- }
-
- protected function tearDown()
- {
- }
-
- public function testToString()
- {
- $this->assertEquals('"xe_member" as "m"', $this->object->toString());
- }
-
- public function testGetName()
- {
- $this->assertEquals('"xe_member"', $this->object->getName());
- }
-
- public function testGetAlias()
- {
- $this->assertEquals('"m"', $this->object->getAlias());
- }
-
- public function testIsJoinTable()
- {
- $this->assertEquals(false, $this->object->isJoinTable());
- }
-}
-?>
diff --git a/tests/classes/db/classes/xml/xmlquery/argument/ArgumentTest.php b/tests/classes/db/classes/xml/xmlquery/argument/ArgumentTest.php
deleted file mode 100644
index ca44d5dda..000000000
--- a/tests/classes/db/classes/xml/xmlquery/argument/ArgumentTest.php
+++ /dev/null
@@ -1,281 +0,0 @@
- */
-
-/**
- * Test class for Argument.
- * Generated by PHPUnit on 2011-07-07 at 16:51:29.
- */
-class ArgumentTest extends CubridTest {
-
- public function testErrorMessageIsSent_NotNullCheck(){
- global $lang;
- include(_TEST_PATH_ . "classes/xml/xmlquery/argument/data/en.lang.php");
- $page_argument = new Argument('page', $args->page);
- $page_argument->checkNotNull();
- $this->assertFalse($page_argument->isValid());
- $this->assertEquals("Please input a value for page", $page_argument->getErrorMessage()->message);
- }
-
- public function testErrorMessageIsSent_MinLengthCheck(){
- global $lang;
- include(_TEST_PATH_ . "classes/xml/xmlquery/argument/data/en.lang.php");
-
- $args->page = '123';
- $page_argument = new Argument('page', $args->page);
- $page_argument->checkMinLength(6);
- $this->assertFalse($page_argument->isValid());
- $this->assertEquals("Please align the text length of page", $page_argument->getErrorMessage()->message);
- }
-
- public function testErrorMessageIsSent_MaxLengthCheck(){
- global $lang;
- include(_TEST_PATH_ . "classes/xml/xmlquery/argument/data/en.lang.php");
-
- $args->page = '123';
- $page_argument = new Argument('page', $args->page);
- $page_argument->checkMaxLength(2);
- $this->assertFalse($page_argument->isValid());
- $this->assertEquals("Please align the text length of page", $page_argument->getErrorMessage()->message);
- }
-
- /**
- * @todo Implement testGetType().
- */
- public function testGetType() {
- // Remove the following lines when you implement this test.
- $this->markTestIncomplete(
- 'This test has not been implemented yet.'
- );
- }
-
- /**
- * @todo Implement testSetColumnType().
- */
- public function testSetColumnType() {
- // Remove the following lines when you implement this test.
- $this->markTestIncomplete(
- 'This test has not been implemented yet.'
- );
- }
-
- /**
- * @todo Implement testGetName().
- */
- public function testGetName() {
- // Remove the following lines when you implement this test.
- $this->markTestIncomplete(
- 'This test has not been implemented yet.'
- );
- }
-
- /**
- * @todo Implement testGetValue().
- */
- public function testGetValue() {
- // Remove the following lines when you implement this test.
- $this->markTestIncomplete(
- 'This test has not been implemented yet.'
- );
- }
-
- /**
- * @todo Implement testGetUnescapedValue().
- */
- public function testGetUnescapedValue() {
- // Remove the following lines when you implement this test.
- $this->markTestIncomplete(
- 'This test has not been implemented yet.'
- );
- }
-
- /**
- * @todo Implement testToString().
- */
- public function testToString() {
- // Remove the following lines when you implement this test.
- $this->markTestIncomplete(
- 'This test has not been implemented yet.'
- );
- }
-
- /**
- * @todo Implement testEscapeValue().
- */
- public function testEscapeValue() {
- // Remove the following lines when you implement this test.
- $this->markTestIncomplete(
- 'This test has not been implemented yet.'
- );
- }
-
- /**
- * @todo Implement testIsValid().
- */
- public function testIsValid() {
- // Remove the following lines when you implement this test.
- $this->markTestIncomplete(
- 'This test has not been implemented yet.'
- );
- }
-
- /**
- * @todo Implement testGetErrorMessage().
- */
- public function testGetErrorMessage() {
- // Remove the following lines when you implement this test.
- $this->markTestIncomplete(
- 'This test has not been implemented yet.'
- );
- }
-
- /**
- * @todo Implement testEnsureDefaultValue().
- */
- public function testEnsureDefaultValue() {
- // Remove the following lines when you implement this test.
- $this->markTestIncomplete(
- 'This test has not been implemented yet.'
- );
- }
-
- /**
- * @todo Implement testCheckFilter().
- */
- public function testCheckFilter() {
- // Remove the following lines when you implement this test.
- $this->markTestIncomplete(
- 'This test has not been implemented yet.'
- );
- }
-
- /**
- * @todo Implement testCheckMaxLength().
- */
- public function testCheckMaxLength() {
- // Remove the following lines when you implement this test.
- $this->markTestIncomplete(
- 'This test has not been implemented yet.'
- );
- }
-
- /**
- * @todo Implement testCheckMinLength().
- */
- public function testCheckMinLength() {
- // Remove the following lines when you implement this test.
- $this->markTestIncomplete(
- 'This test has not been implemented yet.'
- );
- }
-
- /**
- * Checks that argument is valid after a notnull check when value is not null
- */
- public function testCheckNotNullWhenNotNull() {
- $member_srl_argument = new ConditionArgument('member_srl', 20, 'equal');
- $member_srl_argument->checkNotNull();
-
- $this->assertEquals(true, $member_srl_argument->isValid());
- }
-
- /**
- * Checks that argument becomes invalid after a notnull check when value is null
- */
- public function testCheckNotNullWhenNull() {
- $member_srl_argument = new ConditionArgument('member_srl', null, 'equal');
- $member_srl_argument->checkNotNull();
-
- $this->assertEquals(false, $member_srl_argument->isValid());
- }
-
- /**
- * Checks that argument value stays the same when both user value and default value are given
- */
- public function testCheckDefaultValueWhenNotNull() {
- $member_srl_argument = new ConditionArgument('member_srl', 20, 'equal');
- $member_srl_argument->ensureDefaultValue(25);
-
- $this->assertEquals(20, $member_srl_argument->getValue());
- }
-
- /**
- * Checks that argument value gets set when user value is null and default value is specified
- */
- public function testCheckDefaultValueWhenNull() {
- $member_srl_argument = new ConditionArgument('member_srl', null, 'equal');
- $member_srl_argument->ensureDefaultValue(25);
-
- $this->assertEquals(25, $member_srl_argument->getValue());
- }
-
- /**
- * Checks like prefix operation
- */
- public function testCreateConditionValue_LikePrefix() {
- $member_srl_argument = new ConditionArgument('"mid"', 'forum', 'like_prefix');
- $member_srl_argument->createConditionValue();
-
- $this->assertEquals('\'forum%\'', $member_srl_argument->getValue());
- }
-
- /**
- * Checks like tail operation
- */
- public function testCreateConditionValue_LikeTail() {
- $member_srl_argument = new ConditionArgument('"mid"', 'forum', 'like_tail');
- $member_srl_argument->createConditionValue();
-
- $this->assertEquals('\'%forum\'', $member_srl_argument->getValue());
- }
-
- /**
- * Checks like operation
- */
- public function testCreateConditionValue_Like() {
- $member_srl_argument = new ConditionArgument('"mid"', 'forum', 'like');
- $member_srl_argument->createConditionValue();
-
- $this->assertEquals('\'%forum%\'', $member_srl_argument->getValue());
- }
-
-
- /**
- * Checks in operation
- */
- public function testCreateConditionValue_In_StringValues() {
- $member_srl_argument = new ConditionArgument('"mid"', array('forum', 'board'), 'in');
- $member_srl_argument->createConditionValue();
- $member_srl_argument->setColumnType('varchar');
-
- $this->assertEquals('(\'forum\',\'board\')', $member_srl_argument->getValue());
- }
-
- /**
- * Checks in operation
- */
- public function testCreateConditionValue_In_NumericValues() {
- $member_srl_argument = new ConditionArgument('"module_srl"', array(3, 21), 'in');
- $member_srl_argument->setColumnType('number');
- $member_srl_argument->createConditionValue();
-
- $this->assertEquals('(3,21)', $member_srl_argument->getValue());
- }
-
- public function testEnsureDefaultValueWithEmptyString(){
- $homepage_argument = new Argument('homepage', '');
- $homepage_argument->ensureDefaultValue('');
- $homepage_argument->checkFilter('homepage');
- if(!$homepage_argument->isValid()) return $homepage_argument->getErrorMessage();
- $homepage_argument->setColumnType('varchar');
-
-
- $this->assertEquals('\'\'', $homepage_argument->getValue());
- }
-
- public function testDefaultValue() {
- $default = new DefaultValue("var", '');
- $this->assertEquals('\'\'', $default->toString());
- }
-}
-
-?>
diff --git a/tests/classes/db/classes/xml/xmlquery/argument/ConditionArgumentTest.php b/tests/classes/db/classes/xml/xmlquery/argument/ConditionArgumentTest.php
deleted file mode 100644
index 23ded1838..000000000
--- a/tests/classes/db/classes/xml/xmlquery/argument/ConditionArgumentTest.php
+++ /dev/null
@@ -1,65 +0,0 @@
- */
-
-/**
- * Test class for ConditionArgument.
- */
-class ConditionArgumentTest extends CubridTest {
-
- function testIn(){
- $args->document_srl = 1234;
- $document_srl_argument = new ConditionArgument('document_srl', $args->document_srl, 'in');
- $document_srl_argument->checkNotNull();
- $document_srl_argument->createConditionValue();
- if(!$document_srl_argument->isValid()) return $document_srl_argument->getErrorMessage();
- $document_srl_argument->setColumnType('number');
-
- $condition = new ConditionWithArgument('"extra_vars"."document_srl"',$document_srl_argument,"in", 'and');
- $this->assertEquals('and "extra_vars"."document_srl" in (1234)', $condition->toString());
- }
-
- function testZeroValue(){
- $args->site_srl = 0;
- $site_srl_argument = new ConditionArgument('site_srl', $args->site_srl, 'equal');
- $site_srl_argument->checkNotNull();
- $site_srl_argument->createConditionValue();
- if(!$site_srl_argument->isValid()) return $site_srl_argument->getErrorMessage();
- $site_srl_argument->setColumnType('number');
-
- $condition = new ConditionWithArgument('"sites"."site_srl"',$site_srl_argument,"equal");
- $this->assertEquals(' "sites"."site_srl" = 0', $condition->toString());
- }
-
- /**
- * @todo Implement testCreateConditionValue().
- */
- public function testCreateConditionValue() {
- // Remove the following lines when you implement this test.
- $this->markTestIncomplete(
- 'This test has not been implemented yet.'
- );
- }
-
- /**
- * @todo Implement testGetType().
- */
- public function testGetType() {
- // Remove the following lines when you implement this test.
- $this->markTestIncomplete(
- 'This test has not been implemented yet.'
- );
- }
-
- /**
- * @todo Implement testSetColumnType().
- */
- public function testSetColumnType() {
- // Remove the following lines when you implement this test.
- $this->markTestIncomplete(
- 'This test has not been implemented yet.'
- );
- }
-
-}
-
-?>
diff --git a/tests/classes/db/classes/xml/xmlquery/argument/data/en.lang.php b/tests/classes/db/classes/xml/xmlquery/argument/data/en.lang.php
deleted file mode 100644
index 9d07584f7..000000000
--- a/tests/classes/db/classes/xml/xmlquery/argument/data/en.lang.php
+++ /dev/null
@@ -1,323 +0,0 @@
- */
-/**
- * @file common/lang/en.lang.php
- * @author NAVER (developers@xpressengine.com)
- * @brief English Language Pack (Only basic words are included here)
- **/
-
-// words for action, which is basically used
-$lang->cmd_write = 'Write';
-$lang->cmd_reply = 'Reply';
-$lang->cmd_delete = 'Delete';
-$lang->cmd_modify = 'Modify';
-$lang->cmd_edit = 'Edit';
-$lang->cmd_view = 'View';
-$lang->cmd_view_all = 'View All';
-$lang->cmd_list = 'List';
-$lang->cmd_prev = 'Prev';
-$lang->cmd_next = 'Next';
-$lang->cmd_send_trackback = 'Send Trackback';
-$lang->cmd_registration = $lang->cmd_submit = 'Submit';
-$lang->cmd_comment_registration = 'Add Comment';
-$lang->cmd_insert = 'Insert';
-$lang->cmd_save = 'Save';
-$lang->cmd_load = 'Load';
-$lang->cmd_input = 'Input';
-$lang->cmd_search = 'Search';
-$lang->cmd_find = 'Find';
-$lang->cmd_replace = 'Replace';
-$lang->cmd_confirm = 'Confirm';
-$lang->cmd_cancel = 'Cancel';
-$lang->cmd_back = 'Go Back';
-$lang->cmd_vote = 'Recommend';
-$lang->cmd_vote_down = 'Criticize';
-$lang->cmd_declare = 'Accuse';
-$lang->cmd_cancel_declare = 'Cancel Accuse';
-$lang->cmd_declared_list = 'Accusations List';
-$lang->cmd_copy = 'Copy';
-$lang->cmd_move = 'Move';
-$lang->cmd_move_up = 'Up';
-$lang->cmd_move_down = 'Down';
-$lang->cmd_add_indent = 'Indent';
-$lang->cmd_remove_indent = 'Outdent';
-$lang->cmd_management = 'Manage';
-$lang->cmd_make = 'Create';
-$lang->cmd_select = 'Select';
-$lang->cmd_select_all = 'Select All';
-$lang->cmd_unselect_all = 'Deselect All';
-$lang->cmd_reverse_all = 'Reverse';
-$lang->cmd_close_all = 'Close All';
-$lang->cmd_open_all = 'Open All';
-$lang->cmd_reload = 'Reload';
-$lang->cmd_close = 'Close';
-$lang->cmd_open = 'Open';
-$lang->cmd_setup = 'Configure';
-$lang->cmd_addition_setup = 'Additional Setup';
-$lang->cmd_option = 'Option';
-$lang->cmd_apply = 'Apply';
-$lang->cmd_open_calendar = 'Select a Date';
-$lang->cmd_send = 'Send';
-$lang->cmd_print = 'Print';
-$lang->cmd_scrap = 'Scrap';
-$lang->cmd_preview = 'Preview';
-$lang->cmd_reset = 'Reset';
-$lang->cmd_remake_cache = "Re-create cache file";
-$lang->cmd_publish = "Publish";
-$lang->cmd_layout_setup = 'Configure layout';
-$lang->cmd_layout_edit = 'Edit layout';
-$lang->cmd_search_by_ipaddress = 'Search by IP Address';
-$lang->cmd_add_ip_to_spamfilter = 'Add IP to spamfilter';
-
-$lang->enable = 'Enable';
-$lang->disable = 'Disable';
-
-// Essential Words
-$lang->menu = 'Menu';
-$lang->no = 'No.';
-$lang->notice = 'Notice';
-$lang->secret = 'Secret';
-$lang->category = $lang->category_srl = 'Category';
-$lang->none_category = 'None category';
-$lang->none_image = 'Image does not exist';
-$lang->document_srl = 'Doc. No.';
-$lang->user_id = 'User ID';
-$lang->author = 'Developer';
-$lang->password = 'Password';
-$lang->password1 = 'Password';
-$lang->password2 = 'Retype Password';
-$lang->admin_id = 'Admin ID';
-$lang->writer = 'Author';
-$lang->user_name = 'User Name';
-$lang->nick_name = 'Nick Name';
-$lang->email_address = 'Email';
-$lang->homepage = 'Homepage';
-$lang->blog = 'Blog';
-$lang->birthday = 'Birthday';
-$lang->browser_title = 'Browser Title';
-$lang->title = 'Subject';
-$lang->title_content = 'Subject+Content';
-$lang->topic = 'Topic';
-$lang->replies = 'Reply';
-$lang->content = 'Content';
-$lang->document = 'Article';
-$lang->comment = 'Comment';
-$lang->description = 'Description';
-$lang->trackback = 'Trackback';
-$lang->tag = 'Tag';
-$lang->allow_comment = 'Allow Comments';
-$lang->lock_comment = 'Block Comments';
-$lang->allow_trackback = 'Allow Trackbacks';
-$lang->uploaded_file = 'Attachment';
-$lang->grant = 'Permission';
-$lang->target = 'Target';
-$lang->total = 'Total';
-$lang->total_count = 'Count Total';
-$lang->ipaddress = 'IP Address';
-$lang->path = 'Path';
-$lang->cart = 'Selected Item';
-$lang->friend = 'Friends';
-$lang->notify = 'Notification';
-$lang->order_target = 'Align Target';
-$lang->order_type = 'Sorting Type';
-$lang->order_asc = 'ascend';
-$lang->order_desc = 'descend';
-$lang->file = 'file';
-
-$lang->mid = 'Module Name';
-$lang->sid = 'Site Name';
-$lang->layout = 'Layout';
-$lang->mobile_layout = 'Mobile Layout';
-$lang->widget = 'Widget';
-$lang->module = 'Module';
-$lang->skin = 'Theme';
-$lang->mobile_skin = 'Mobile Theme';
-$lang->colorset = 'Colorset';
-$lang->extra_vars = 'Extra Vars';
-
-$lang->domain = "Domain Name";
-$lang->url = "URL";
-$lang->document_url = 'Article URL';
-$lang->trackback_url = 'Trackback URL';
-$lang->blog_name = 'Blog Title';
-$lang->excerpt = 'Quotation';
-
-$lang->document_count = 'Total Articles';
-$lang->page_count = 'Page Count';
-$lang->list_count = 'List Count';
-$lang->search_list_count = 'Search List Count';
-$lang->readed_count = 'Views';
-$lang->voted_count = 'Votes';
-$lang->comment_count = 'Comments';
-$lang->member_count = 'Member Count';
-$lang->date = 'Date';
-$lang->regdate = 'Registered Date';
-$lang->last_update = 'Last Update';
-$lang->last_post = 'Last Post';
-$lang->signup_date = 'Sign up Date';
-$lang->last_login = 'Last Sign in';
-$lang->first_page = 'First Page';
-$lang->last_page = 'Last Page';
-$lang->search_target = 'Target for Search';
-$lang->search_keyword = 'Keyword';
-$lang->is_default = 'Default';
-
-$lang->no_documents = 'No Articles';
-
-$lang->board_manager = 'Board Settings';
-$lang->member_manager = 'Member Settings';
-$lang->layout_manager = 'Layout Settings';
-
-$lang->use = 'Use';
-$lang->notuse = 'Not use';
-$lang->not_exists = "Doesn't exist";
-
-$lang->public = 'public';
-$lang->private = 'private';
-
-$lang->unit_sec = 'sec';
-$lang->unit_min = 'min';
-$lang->unit_hour = 'hr';
-$lang->unit_day = 'th';
-$lang->unit_month = 'month';
-$lang->unit_year = 'year';
-
-$lang->unit_week = array(
- 'Monday' => 'Monday',
- 'Tuesday' => 'Tuesday',
- 'Wednesday' => 'Wednesday',
- 'Thursday' => 'Thursday',
- 'Friday' => 'Friday',
- 'Saturday' => 'Saturday',
- 'Sunday' => 'Sunday',
-);
-
-$lang->unit_meridiem = array(
- 'am' => 'am',
- 'pm' => 'pm',
- 'AM' => 'AM',
- 'PM' => 'PM',
-);
-
-$lang->time_gap = array(
- 'min' => '%d minute ago',
- 'mins' => '%d minutes ago',
- 'hour' => '%d hour ago',
- 'hours' => '%d hours ago',
-);
-
-// Descriptions
-$lang->about_tag = 'You may submit multiple tags by inserting commas(,) between each tag';
-$lang->about_layout = 'Layouts decorate the appearance of your modules. you can configure them from Layout menu on the top';
-
-// Messages
-$lang->msg_call_server = 'Requesting to the server, please wait';
-$lang->msg_db_not_setted = 'DB configuration has not been set';
-$lang->msg_dbconnect_failed = "Error has occurred while connecting DB.\nPlease check DB information again";
-$lang->msg_invalid_queryid = 'Specified query ID value is invalid';
-$lang->msg_not_permitted = 'You do not have permission to access';
-$lang->msg_input_password = 'Please input the password';
-$lang->msg_invalid_document = 'Invalid Article Number';
-$lang->msg_invalid_request = 'Invalid Request';
-$lang->msg_invalid_password = 'Invalid Password';
-$lang->msg_error_occured = 'An error has occured';
-$lang->msg_not_founded = 'Target could not be found';
-$lang->msg_no_result = 'Nothing found';
-$lang->msg_fail_to_request_open = 'Fail to open your request';
-$lang->msg_invalid_format = 'Invalid Format';
-
-$lang->msg_not_permitted_act = 'You do not have permission to execute requested action';
-$lang->msg_module_does_not_exist = "Couldn't find the requested module.\nPlease contact the administrator.";
-$lang->msg_module_is_not_standalone = 'Requested module cannot be executed independently';
-$lang->msg_default_url_is_not_defined = 'Default URL is not defined';
-
-$lang->success_registed = 'Registered successfully';
-$lang->success_declared = 'Accused successfully';
-$lang->success_updated = 'Updated successfully';
-$lang->success_deleted = 'Deleted successfully';
-$lang->success_voted = 'Recommended successfully';
-$lang->success_blamed = 'Blamed successfully';
-$lang->success_moved = 'Moved successfully';
-$lang->success_sended = 'Sent successfully';
-$lang->success_reset = 'Reset successfully';
-$lang->success_leaved = 'All member data have been deleted completely.';
-$lang->success_saved = 'Saved successfully';
-
-$lang->fail_to_delete = 'Could not be deleted';
-$lang->fail_to_move = 'Could not be moved';
-
-$lang->failed_voted = 'Could not recommend';
-$lang->failed_blamed = 'Could not blame';
-$lang->failed_declared = 'Could not accuse';
-$lang->fail_to_delete_have_children = 'Please try again after removing replies first';
-
-$lang->confirm_submit = 'Are you sure to submit?';
-$lang->confirm_logout = 'Are you sure to logout?';
-$lang->confirm_vote = 'Are you sure to recommend?';
-$lang->confirm_delete = 'Are you sure to delete?';
-$lang->confirm_move = 'Are you sure to move?';
-$lang->confirm_reset = 'Are you sure to reset?';
-$lang->confirm_leave = 'Are you sure to leave?';
-$lang->confirm_update = 'Are you sure to update?';
-
-$lang->column_type = 'Column Type';
-$lang->column_type_list['text'] = 'one-line text';
-$lang->column_type_list['homepage'] = 'url';
-$lang->column_type_list['email_address'] = 'email';
-$lang->column_type_list['tel'] = 'phone number';
-$lang->column_type_list['textarea'] = 'multi-line textarea';
-$lang->column_type_list['checkbox'] = 'checkbox (multiple selection)';
-$lang->column_type_list['select'] = 'select box (single selection)';
-$lang->column_type_list['radio'] = 'radio button (radio)';
-$lang->column_type_list['kr_zip'] = 'zip code (Korean)';
-$lang->column_type_list['date'] = 'date (yyyy/mm/dd)';
-//$lang->column_type_list['jp_zip'] = 'zip code (Japanese)';
-$lang->column_name = 'Column Name';
-$lang->column_title = 'Column Title';
-$lang->default_value = 'Default Value';
-$lang->is_active = 'Active';
-$lang->is_required = 'Required Field';
-$lang->eid = 'Name of extra variable';
-
-// ftp-related
-$lang->ftp_form_title = 'FTP Account Information';
-$lang->ftp = 'FTP';
-$lang->ftp_host = 'FTP hostname';
-$lang->ftp_port = 'FTP port';
-$lang->about_ftp_password = 'FTP password will not be stored';
-$lang->cmd_check_ftp_connect = 'Check FTP Connection';
-$lang->about_ftp_info = "
- FTP account information can be used in following cases.
- 1. If safe_mode setting of PHP is on, XE will be installed using FTP.
- 2. Automatic updates might use FTP information.
- This account info will be stored in files/config/ftp.config.php
- After installation, you can modify or delete the account info at the administration page.
-";
-
-$lang->msg_safe_mode_ftp_needed = "If safe_mode setting of PHP is on, you should input FTP account information to install XE.";
-$lang->msg_ftp_not_connected = "Connection to localhost via FTP failed. Please check the port number and if FTP service is available.";
-$lang->msg_ftp_invalid_auth_info = "Authentication failed. Please check the username and password.";
-$lang->msg_ftp_mkdir_fail = "Directory creation failed. Please check the permission of FTP account.";
-$lang->msg_ftp_chmod_fail = "Chmod failed. Please check the permission and configuration of FTP server.";
-$lang->msg_ftp_connect_success = "Connection and authentication to the FTP server succeeded.";
-
-$lang->ftp_path_title = 'FTP Path Information';
-$lang->msg_ftp_installed_realpath = 'Absolute Path of XE';
-$lang->msg_ftp_installed_ftp_realpath = 'Absolute FTP Path of XE';
-
-// Alert messages for Javascript using by XML filter
-$lang->filter->isnull = 'Please input a value for %s';
-$lang->filter->outofrange = 'Please align the text length of %s';
-$lang->filter->equalto = "The value of %s is invalid";
-$lang->filter->invalid_email = "The format of %s is invalid. ex) developers@xpressengine.com";
-$lang->filter->invalid_user_id = $lang->filter->invalid_userid = "The format of %s is invalid.\\nAll values should consist of alphabets, numbers or underscore(_) and the first letter should be alphabet";
-$lang->filter->invalid_homepage = "The format of %s is invalid. ex) http://xpressengine.com/";
-$lang->filter->invalid_korean = "The format of %s is invalid. Please input Korean only";
-$lang->filter->invalid_korean_number = "The format of %s is invalid. Please input Korean or numbers";
-$lang->filter->invalid_alpha = "The format of %s is invalid. Please input alphabets only";
-$lang->filter->invalid_alpha_number = "The format of %s is invalid. Please input alphabets or numbers";
-$lang->filter->invalid_number = "The format of %s is invalid. Please input numbers only";
-
-$lang->security_warning_embed = "Due to security concern, administrators are not allowed to view embedded items.
To view them, please use another non-administrator ID.";
-$lang->msg_pc_to_mobile = '이 페이지는 모바일 보기가 있습니다. 모바일 보기로 이동하시겠습니까?';
-?>
diff --git a/tests/classes/db/classes/xml/xmlquery/queryargument/QueryArgumentTest.php b/tests/classes/db/classes/xml/xmlquery/queryargument/QueryArgumentTest.php
deleted file mode 100644
index aafc07268..000000000
--- a/tests/classes/db/classes/xml/xmlquery/queryargument/QueryArgumentTest.php
+++ /dev/null
@@ -1,16 +0,0 @@
- */
-
-/**
- * Test class for QueryArgument.
- */
-class QueryArgumentTest extends CubridTest {
-
- var $xmlPath = "data/";
-
- function QueryArgumentTest(){
- $this->xmlPath = str_replace('QueryArgumentTest.php', '', str_replace('\\', '/', __FILE__)) . $this->xmlPath;
- }
- }
-
-?>
diff --git a/tests/classes/db/classes/xml/xmlquery/queryargument/data/condition1.xml b/tests/classes/db/classes/xml/xmlquery/queryargument/data/condition1.xml
deleted file mode 100644
index 53decc580..000000000
--- a/tests/classes/db/classes/xml/xmlquery/queryargument/data/condition1.xml
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/tests/classes/db/classes/xml/xmlquery/queryargument/data/index1.xml b/tests/classes/db/classes/xml/xmlquery/queryargument/data/index1.xml
deleted file mode 100644
index 6cbf9193a..000000000
--- a/tests/classes/db/classes/xml/xmlquery/queryargument/data/index1.xml
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/tests/classes/db/classes/xml/xmlquery/tags/condition/ConditionTagTest.php b/tests/classes/db/classes/xml/xmlquery/tags/condition/ConditionTagTest.php
deleted file mode 100644
index 97dda224b..000000000
--- a/tests/classes/db/classes/xml/xmlquery/tags/condition/ConditionTagTest.php
+++ /dev/null
@@ -1,88 +0,0 @@
- */
-
-/**
- * Test class for ConditionTag.
- */
-class ConditionTagTest extends CubridTest {
-
- var $xmlPath = "data/";
-
- function ConditionTagTest(){
- $this->xmlPath = str_replace('ConditionTagTest.php', '', str_replace('\\', '/', __FILE__)) . $this->xmlPath;
- }
-
- /**
- * Tests a simple tag:
- *
- */
- function testConditionStringWithArgument(){
- $xml_file = $this->xmlPath . "condition1.xml";
- $xml_obj = Helper::getXmlObject($xml_file);
- $tag = new ConditionTag($xml_obj->condition);
- $arguments = $tag->getArguments();
-
- $expected = "new ConditionWithArgument('\"user_id\"',\$" . $arguments[0]->getArgumentName() . "_argument,\"equal\")";
- $actual = $tag->getConditionString();
- $this->assertEquals($expected, $actual);
-
-
- $this->assertEquals(1, count($arguments));
- }
-
- /**
- * Tests a condition tag for joins - that uses no argument
- *
- */
- function testConditionStringWithoutArgument(){
- $xml_file = $this->xmlPath . "condition3.xml";
- $xml_obj = Helper::getXmlObject($xml_file);
- $tag = new ConditionTag($xml_obj->condition);
-
- $expected = "new ConditionWithoutArgument('\"comments\".\"user_id\"','\"member\".\"user_id\"',\"equal\")";
- $actual = $tag->getConditionString();
- $this->assertEquals($expected, $actual);
-
- $arguments = $tag->getArguments();
- $this->assertEquals(0, count($arguments));
- }
-
-
- /**
- * Tests a tag with pipe:
- *
- */
- function testConditionStringWithPipe(){
- $xml_file = $this->xmlPath . "condition2.xml";
- $xml_obj = Helper::getXmlObject($xml_file);
- $tag = new ConditionTag($xml_obj->condition);
- $arguments = $tag->getArguments();
-
- $expected = "new ConditionWithArgument('\"type\"',\$" . $arguments[0]->getArgumentName() . "_argument,\"equal\", 'and')";
- $actual = $tag->getConditionString();
- $this->assertEquals($expected, $actual);
-
-
- $this->assertEquals(1, count($arguments));
- }
-
- /**
- * Tests that even if the column name is given in the var attribute, it knows it's just a name and not an argument
- *
- */
- function testConditionStringWithoutArgumentAndDefaultValueInsideVar(){
- $xml_file = $this->xmlPath . "condition4.xml";
- $xml_obj = Helper::getXmlObject($xml_file);
- $tag = new ConditionTag($xml_obj->condition);
-
- $expected = "new ConditionWithoutArgument('\"modules\".\"module_srl\"','\"documents\".\"module_srl\"',\"equal\", 'and')";
- $actual = $tag->getConditionString();
- $this->assertEquals($expected, $actual);
-
- $arguments = $tag->getArguments();
- $this->assertEquals(0, count($arguments));
- }
-
-}
-
-?>
diff --git a/tests/classes/db/classes/xml/xmlquery/tags/condition/data/condition1.xml b/tests/classes/db/classes/xml/xmlquery/tags/condition/data/condition1.xml
deleted file mode 100644
index 274121640..000000000
--- a/tests/classes/db/classes/xml/xmlquery/tags/condition/data/condition1.xml
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/tests/classes/db/classes/xml/xmlquery/tags/condition/data/condition2.xml b/tests/classes/db/classes/xml/xmlquery/tags/condition/data/condition2.xml
deleted file mode 100644
index 7ace26b8d..000000000
--- a/tests/classes/db/classes/xml/xmlquery/tags/condition/data/condition2.xml
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/tests/classes/db/classes/xml/xmlquery/tags/condition/data/condition3.xml b/tests/classes/db/classes/xml/xmlquery/tags/condition/data/condition3.xml
deleted file mode 100644
index 538d81f3d..000000000
--- a/tests/classes/db/classes/xml/xmlquery/tags/condition/data/condition3.xml
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/tests/classes/db/classes/xml/xmlquery/tags/condition/data/condition4.xml b/tests/classes/db/classes/xml/xmlquery/tags/condition/data/condition4.xml
deleted file mode 100644
index ac432b118..000000000
--- a/tests/classes/db/classes/xml/xmlquery/tags/condition/data/condition4.xml
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/tests/classes/db/classes/xml/xmlquery/tags/table/TableTagTest.php b/tests/classes/db/classes/xml/xmlquery/tags/table/TableTagTest.php
deleted file mode 100644
index d449b65fc..000000000
--- a/tests/classes/db/classes/xml/xmlquery/tags/table/TableTagTest.php
+++ /dev/null
@@ -1,133 +0,0 @@
- */
- /**
- * Test class for TableTag.
- */
- class TableTagTest extends CubridTest {
-
- var $xmlPath = "data/";
-
- function TableTagTest(){
- $this->xmlPath = str_replace('TableTagTest.php', '', str_replace('\\', '/', __FILE__)) . $this->xmlPath;
- }
-
- /**
- * Tests a simple tag:
- *
- */
- function testTableTagWithName(){
- $xml_file = $this->xmlPath . "table_name.xml";
- $xml_obj = Helper::getXmlObject($xml_file);
- $tag = new TableTag($xml_obj->table);
-
- $expected = "new Table('\"xe_modules\"', '\"modules\"')";
- $actual = $tag->getTableString();
- $this->assertEquals($expected, $actual);
- }
-
- /**
- * Tests a tag with name and alias
- *
- */
- function testTableTagWithNameAndAlias(){
- $xml_file = $this->xmlPath . "table_name_alias.xml";
- $xml_obj = Helper::getXmlObject($xml_file);
-
- $tag = new TableTag($xml_obj->table);
-
- $expected = "new Table('\"xe_modules\"', '\"mod\"')";
- $actual = $tag->getTableString();
- $this->assertEquals($expected, $actual);
- }
-
- /**
- * Tests a tag used for joins
- *
- *
- */
- function testTableTagWithJoinCondition(){
- $xml_file = $this->xmlPath . "table_name_alias_type.xml";
- $xml_obj = Helper::getXmlObject($xml_file);
-
- $tag = new TableTag($xml_obj->table);
-
- $actual = $tag->getTableString();
-
- $expected = 'new JoinTable(\'"xe_module_categories"\', \'"module_categories"\', "left join", array(
- new ConditionGroup(array(
- new ConditionWithoutArgument(\'"module_categories"."module_category_srl"\',\'"modules"."module_category_srl"\',"equal")
- ))
- ))';
- $actual = Helper::cleanString($actual);
- $expected = Helper::cleanString($expected);
-
- $this->assertEquals($expected, $actual);
- }
-
- /**
- * If a table tag has the type attribute and condition children
- * it means it is meant to be used inside a join
- */
- function testTagWithTypeIsJoinTable(){
- $xml_file = $this->xmlPath . "table_name_alias_type.xml";
- $xml_obj = Helper::getXmlObject($xml_file);
-
- $tag = new TableTag($xml_obj->table);
-
- $this->assertEquals(true, $tag->isJoinTable());
- }
-
- /**
- * Tests that a simple table tag is not a join table
- */
- function testTagWithoutTypeIsNotJoinTable(){
- $xml_file = $this->xmlPath . "table_name_alias.xml";
- $xml_obj = Helper::getXmlObject($xml_file);
-
- $tag = new TableTag($xml_obj->table);
-
- $this->assertEquals(false, $tag->isJoinTable());
- }
-
- /**
- * If no alias is specified, test that table name is used
- */
- function testTableAliasWhenAliasNotSpecified(){
- $xml_file = $this->xmlPath . "table_name.xml";
- $xml_obj = Helper::getXmlObject($xml_file);
-
- $tag = new TableTag($xml_obj->table);
-
- $this->assertEquals("modules", $tag->getTableAlias());
- }
-
- /**
- * If alias is specified, test that it is used
- */
- function testTableAliasWhenAliasSpecified(){
- $xml_file = $this->xmlPath . "table_name_alias.xml";
- $xml_obj = Helper::getXmlObject($xml_file);
-
- $tag = new TableTag($xml_obj->table);
-
- $this->assertEquals("mod", $tag->getTableAlias());
- }
-
- /**
- * Table name propery should returned unescaped and unprefixed table name
- * (The one in the XML file)
- */
- function testTableName(){
- $xml_file = $this->xmlPath . "table_name_alias.xml";
- $xml_obj = Helper::getXmlObject($xml_file);
-
- $tag = new TableTag($xml_obj->table);
-
- $this->assertEquals("modules", $tag->getTableName());
- }
-
- }
diff --git a/tests/classes/db/classes/xml/xmlquery/tags/table/TablesTagTest.php b/tests/classes/db/classes/xml/xmlquery/tags/table/TablesTagTest.php
deleted file mode 100644
index 466c22cad..000000000
--- a/tests/classes/db/classes/xml/xmlquery/tags/table/TablesTagTest.php
+++ /dev/null
@@ -1,113 +0,0 @@
- */
- /**
- * Test class for TablesTag.
- */
- class TablesTagTest extends CubridTest {
-
- var $xmlPath = "data/";
-
- function TablesTagTest(){
- $this->xmlPath = str_replace('TablesTagTest.php', '', str_replace('\\', '/', __FILE__)) . $this->xmlPath;
- }
-
- /**
- * Tests a simple tag:
- *
- *
- *
- */
- function testTablesTagWithOneTable(){
- $xml_file = $this->xmlPath . "tables_one_table.xml";
- $xml_obj = Helper::getXmlObject($xml_file);
- $tag = new TablesTag($xml_obj->tables);
-
- $expected = "array(new Table('\"xe_member\"', '\"member\"'))";
- $actual = $tag->toString();
-
- $this->_testCachedOutput($expected, $actual);
- }
-
- /**
- * Tests a simple tag:
- *
- *
- *
- *
- */
- function testTablesTagWithTwoTablesNoJoin(){
- $xml_file = $this->xmlPath . "tables_two_tables_no_join.xml";
- $xml_obj = Helper::getXmlObject($xml_file);
- $tag = new TablesTag($xml_obj->tables);
-
- $expected = "array(
- new Table('\"xe_member_group\"', '\"a\"')
- ,new Table('\"xe_member_group_member\"', '\"b\"')
- )";
- $actual = $tag->toString();
-
- $this->_testCachedOutput($expected, $actual);
- }
-
- /**
- * Tests a simple tag:
- *
- *
- *
- *
- */
- function testTablesTagWithTwoTablesWithJoin(){
- $xml_file = $this->xmlPath . "tables_two_tables_with_join.xml";
- $xml_obj = Helper::getXmlObject($xml_file);
- $tag = new TablesTag($xml_obj->tables);
-
- $expected = "array(
- new Table('\"xe_files\"', '\"files\"')
- ,new JoinTable('\"xe_member\"'
- , '\"member\"'
- , \"left join\"
- , array(
- new ConditionGroup(
- array(
- new ConditionWithoutArgument(
- '\"files\".\"member_srl\"'
- ,'\"member\".\"member_srl\"'
- ,\"equal\"
- )
- )
- )
- )
- )
- )";
- $actual = $tag->toString();
-
- $this->_testCachedOutput($expected, $actual);
- }
-
- /**
- * Tests a simple tag:
- *
- *
- *
- *
- */
- function testGetTables(){
- $xml_file = $this->xmlPath . "tables_two_tables_with_join.xml";
- $xml_obj = Helper::getXmlObject($xml_file);
- $tag = new TablesTag($xml_obj->tables);
-
- $tables = $tag->getTables();
-
- $this->assertEquals(2, count($tables));
- $this->assertTrue(is_a($tables[0], 'TableTag'));
- $this->assertTrue(is_a($tables[1], 'TableTag'));
- }
- }
diff --git a/tests/classes/db/classes/xml/xmlquery/tags/table/data/table_name.xml b/tests/classes/db/classes/xml/xmlquery/tags/table/data/table_name.xml
deleted file mode 100644
index 6525964f0..000000000
--- a/tests/classes/db/classes/xml/xmlquery/tags/table/data/table_name.xml
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/tests/classes/db/classes/xml/xmlquery/tags/table/data/table_name_alias.xml b/tests/classes/db/classes/xml/xmlquery/tags/table/data/table_name_alias.xml
deleted file mode 100644
index 8240d4652..000000000
--- a/tests/classes/db/classes/xml/xmlquery/tags/table/data/table_name_alias.xml
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/tests/classes/db/classes/xml/xmlquery/tags/table/data/table_name_alias_type.xml b/tests/classes/db/classes/xml/xmlquery/tags/table/data/table_name_alias_type.xml
deleted file mode 100644
index 6d8e7f1d5..000000000
--- a/tests/classes/db/classes/xml/xmlquery/tags/table/data/table_name_alias_type.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
\ No newline at end of file
diff --git a/tests/classes/db/classes/xml/xmlquery/tags/table/data/tables_one_table.xml b/tests/classes/db/classes/xml/xmlquery/tags/table/data/tables_one_table.xml
deleted file mode 100644
index 525df54be..000000000
--- a/tests/classes/db/classes/xml/xmlquery/tags/table/data/tables_one_table.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/classes/xml/xmlquery/tags/table/data/tables_two_tables_no_join.xml b/tests/classes/db/classes/xml/xmlquery/tags/table/data/tables_two_tables_no_join.xml
deleted file mode 100644
index cdedcb831..000000000
--- a/tests/classes/db/classes/xml/xmlquery/tags/table/data/tables_two_tables_no_join.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/classes/xml/xmlquery/tags/table/data/tables_two_tables_with_join.xml b/tests/classes/db/classes/xml/xmlquery/tags/table/data/tables_two_tables_with_join.xml
deleted file mode 100644
index fd8d8775e..000000000
--- a/tests/classes/db/classes/xml/xmlquery/tags/table/data/tables_two_tables_with_join.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/config/config.inc.php b/tests/classes/db/config/config.inc.php
deleted file mode 100644
index 3d18c86c3..000000000
--- a/tests/classes/db/config/config.inc.php
+++ /dev/null
@@ -1,64 +0,0 @@
- */
-
-error_reporting(E_ALL ^ E_NOTICE);
-define('_XE_PATH_', str_replace('tests/classes/db/config/config.inc.php', '', str_replace('\\', '/', __FILE__)));
-define('_TEST_PATH_', _XE_PATH_ . 'tests/classes/db/');
-
-if(!defined('__DEBUG__')) define('__DEBUG__', 4);
-
-define('__ZBXE__', true);
-define('__XE__', true);
-
-require_once(_TEST_PATH_.'Helper.class.php');
-require_once(_TEST_PATH_.'QueryTester.class.php');
-require_once(_TEST_PATH_.'db/DBTest.php');
-require_once(_TEST_PATH_.'db/CubridTest.php');
-require_once(_TEST_PATH_.'db/CubridOnlineTest.php');
-require_once(_TEST_PATH_.'db/MssqlTest.php');
-require_once(_TEST_PATH_.'db/MssqlOnlineTest.php');
-require_once(_TEST_PATH_.'db/MysqlTest.php');
-require_once(_TEST_PATH_.'db/SqliteTest.php');
-
-require_once(_XE_PATH_.'config/config.inc.php');
-require_once(_XE_PATH_.'classes/xml/XmlQueryParser.class.php');
-
-require_once(_XE_PATH_.'classes/db/DB.class.php');
-require_once(_XE_PATH_.'classes/db/DBCubrid.class.php');
-require_once(_XE_PATH_.'classes/db/DBMssql.class.php');
-require_once(_XE_PATH_.'classes/db/DBMysql.class.php');
-require_once(_TEST_PATH_.'db/MockDb.php');
-
-require_once(_XE_PATH_.'classes/xml/xmlquery/DBParser.class.php');
-require_once(_XE_PATH_.'classes/xml/xmlquery/argument/Argument.class.php');
-require_once(_XE_PATH_.'classes/xml/xmlquery/argument/SortArgument.class.php');
-require_once(_XE_PATH_.'classes/xml/xmlquery/argument/ConditionArgument.class.php');
-require_once(_XE_PATH_.'classes/xml/xmlquery/queryargument/DefaultValue.class.php');
-require_once(_XE_PATH_.'classes/db/queryparts/expression/Expression.class.php');
-require_once(_XE_PATH_.'classes/db/queryparts/expression/SelectExpression.class.php');
-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');
-require_once(_XE_PATH_.'classes/db/queryparts/table/MysqlTableWithHint.class.php');
-require_once(_XE_PATH_.'classes/db/queryparts/table/MssqlTableWithHint.class.php');
-require_once(_XE_PATH_.'classes/db/queryparts/table/IndexHint.class.php');
-require_once(_XE_PATH_.'classes/db/queryparts/condition/ConditionGroup.class.php');
-require_once(_XE_PATH_.'classes/db/queryparts/condition/Condition.class.php');
-require_once(_XE_PATH_.'classes/db/queryparts/condition/ConditionWithArgument.class.php');
-require_once(_XE_PATH_.'classes/db/queryparts/condition/ConditionWithoutArgument.class.php');
-require_once(_XE_PATH_.'classes/db/queryparts/condition/ConditionSubquery.class.php');
-require_once(_XE_PATH_.'classes/db/queryparts/expression/StarExpression.class.php');
-require_once(_XE_PATH_.'classes/db/queryparts/order/OrderByColumn.class.php');
-require_once(_XE_PATH_.'classes/db/queryparts/limit/Limit.class.php');
-require_once(_XE_PATH_.'classes/db/queryparts/Query.class.php');
-require_once(_XE_PATH_.'classes/db/queryparts/Subquery.class.php');
-
-require_once(_XE_PATH_.'classes/xml/xmlquery/tags/table/TableTag.class.php');
-require_once(_XE_PATH_.'classes/xml/xmlquery/tags/table/HintTableTag.class.php');
-require_once(_XE_PATH_.'classes/xml/xmlquery/tags/condition/ConditionTag.class.php');
-require_once(_XE_PATH_.'classes/xml/xmlquery/queryargument/QueryArgument.class.php');
-require_once(_XE_PATH_.'classes/xml/xmlquery/queryargument/SortQueryArgument.class.php');
diff --git a/tests/classes/db/db/CubridOnlineTest.php b/tests/classes/db/db/CubridOnlineTest.php
deleted file mode 100644
index 0e2556368..000000000
--- a/tests/classes/db/db/CubridOnlineTest.php
+++ /dev/null
@@ -1,50 +0,0 @@
- */
-
- /**
- * Base class for tests for CUBRID SQL syntax
- */
-
- class CubridOnlineTest extends PHPUnit_Framework_TestCase {
-
- protected $backupGlobals = FALSE;
- protected $backupStaticAttributes = FALSE;
- protected $preserveGlobalState = FALSE;
-
- /**
- * Prepare runtime context - tell DB class that current DB is CUBRID
- */
- protected function setUp() {
- $this->markTestSkipped();
- $oContext = &Context::getInstance();
-
- $db_info->master_db = array('db_type' => 'cubrid'
- ,'db_port' => '33000'
- ,'db_hostname' => '10.0.0.206'
- ,'db_userid' => 'dba'
- ,'db_password' => 'arniarules'
- ,'db_database' => 'xe15QA'
- ,'db_table_prefix' => 'xe_');
- $db_info->slave_db = array(array('db_type' => 'cubrid'
- ,'db_port' => '33000'
- ,'db_hostname' => '10.0.0.206'
- ,'db_userid' => 'dba'
- ,'db_password' => 'arniarules'
- ,'db_database' => 'xe15QA'
- ,'db_table_prefix' => 'xe_'));
- $oContext->setDbInfo($db_info);
-
- // remove cache dir
- FileHandler::removeDir( _XE_PATH_ . 'files/cache');
-
- DB::getParser(true);
- }
-
- /**
- * Free resources - reset static DB and QueryParser
- */
- protected function tearDown() {
- unset($GLOBALS['__DB__']);
- }
- }
-?>
diff --git a/tests/classes/db/db/CubridTest.php b/tests/classes/db/db/CubridTest.php
deleted file mode 100644
index dd02378c6..000000000
--- a/tests/classes/db/db/CubridTest.php
+++ /dev/null
@@ -1,32 +0,0 @@
- */
-
- /**
- * Base class for tests for CUBRID SQL syntax
- */
-
- class CubridTest extends DBTest {
-
- /**
- * Prepare runtime context - tell DB class that current DB is CUBRID
- */
- protected function setUp() {
- $oContext = &Context::getInstance();
-
- $db_info->master_db = array('db_type' => 'cubrid','db_table_prefix' => 'xe_');
- $db_info->slave_db = array(array('db_type' => 'cubrid','db_table_prefix' => 'xe_'));
-
- $oContext->setDbInfo($db_info);
-
- $db = new MockDb();
- $db->getParser(true);
- }
-
- /**
- * Free resources - reset static DB and QueryParser
- */
- protected function tearDown() {
- unset($GLOBALS['__DB__']);
- }
- }
-?>
diff --git a/tests/classes/db/db/DBTest.php b/tests/classes/db/db/DBTest.php
deleted file mode 100644
index cdc9e9f83..000000000
--- a/tests/classes/db/db/DBTest.php
+++ /dev/null
@@ -1,75 +0,0 @@
- */
-
-class DBTest extends PHPUnit_Framework_TestCase {
-
- function _testQuery($xml_file, $argsString, $expected, $methodName, $columnList = null){
- echo PHP_EOL . ' ----------------------------------- ' .PHP_EOL;
- echo $xml_file;
- echo PHP_EOL . ' ----------------------------------- ' .PHP_EOL;
-
- $tester = new QueryTester();
- $outputString = $tester->getNewParserOutputString($xml_file, $argsString);
- echo $outputString;
- $output = eval($outputString);
-
- if(!is_a($output, 'Query')){
- if(!$output->toBool()) $querySql = "Date incorecte! Query-ul nu a putut fi executat.";
- }else {
- $db = &DB::getInstance();
- if($columnList) $output->setColumnList($columnList);
- $querySql = $db->{$methodName}($output);
-
- // Remove whitespaces, tabs and all
- if(is_a($querySql, 'Object'))
- {
- $querySql = $querySql->getMessage();
- }
- $querySql = Helper::cleanString($querySql);
- $expected = Helper::cleanString($expected);
- }
- $this->assertEquals($expected, $querySql);
- }
-
- function _testPreparedQuery($xml_file, $argsString, $expected, $methodName, $expectedArgs = NULL){
- echo PHP_EOL . ' ----------------------------------- ' .PHP_EOL;
- echo $xml_file;
- echo PHP_EOL . ' ----------------------------------- ' .PHP_EOL;
-
- $tester = new QueryTester();
- $outputString = $tester->getNewParserOutputString($xml_file, $argsString);
- echo $outputString;
- $output = eval($outputString);
-
- if(!is_a($output, 'Query')){
- if(!$output->toBool()) $querySql = "Date incorecte! Query-ul nu a putut fi executat.";
- }else {
- $db = &DB::getInstance();
- $querySql = $db->{$methodName}($output, false);
- $queryArguments = $output->getArguments();
-
- // Remove whitespaces, tabs and all
- $querySql = Helper::cleanString($querySql);
- $expected = Helper::cleanString($expected);
- }
-
- // Test
- $this->assertEquals($expected, $querySql);
-
- // Test query arguments
- $argCount = count($expectedArgs);
- for($i = 0; $i < $argCount; $i++){
- $this->assertEquals($expectedArgs[$i], $queryArguments[$i]->getEscapedValue());
- }
- }
-
- function _testCachedOutput($expected, $actual){
- $expected = Helper::cleanString($expected);
- $actual = Helper::cleanString($actual);
-
- $this->assertEquals($expected, $actual);
-
- }
- }
-
-?>
diff --git a/tests/classes/db/db/ExpressionParserTest.php b/tests/classes/db/db/ExpressionParserTest.php
deleted file mode 100644
index b48feef46..000000000
--- a/tests/classes/db/db/ExpressionParserTest.php
+++ /dev/null
@@ -1,110 +0,0 @@
- */
-
- class ExpressionParserTest extends PHPUnit_Framework_TestCase {
- /* Escape char for:
- * CUBRID ""
- * MySql ``
- * SqlServer []
- */
- var $dbLeftEscapeChar = '[';
- var $dbRightEscapeChar = ']';
-
- function _test($column_name, $alias, $expected){
- $expressionParser = new DBParser($this->dbLeftEscapeChar,$this->dbRightEscapeChar);
- $actual = $expressionParser->parseExpression($column_name);
- if($alias) $actual .= " as $alias";
- $this->assertEquals($expected, $actual);
- }
-
- function testStarExpressionIsNotEscaped(){
- $this->_test("*", NULL, '*');
- }
-
- function testSimpleColumnNameGetsEscaped(){
- $this->_test("member_srl", NULL
- , $this->dbLeftEscapeChar.'member_srl'.$this->dbRightEscapeChar );
- }
-
- function testUnqualifiedAliasedColumnNameGetsEscaped(){
- $this->_test("member_srl", "id"
- , $this->dbLeftEscapeChar.'member_srl'.$this->dbRightEscapeChar.' as id');
- }
-
- function testQualifiedColumnNameGetsEscaped(){
- $this->_test("xe_members.member_srl", NULL
- , $this->dbLeftEscapeChar.'xe_members'.$this->dbRightEscapeChar.'.'.$this->dbLeftEscapeChar.'member_srl'.$this->dbRightEscapeChar);
- }
-
- function testQualifiedAliasedColumnNameGetsEscaped(){
- $this->_test("xe_members.member_srl","id"
- ,$this->dbLeftEscapeChar.'xe_members'.$this->dbRightEscapeChar.'.'.$this->dbLeftEscapeChar.'member_srl'.$this->dbRightEscapeChar.' as id');
- }
-
- function testCountDoesntGetEscaped(){
- $this->_test("count(*)", NULL, 'count(*)');
- }
-
- function testAliasedCountDoesntGetEscaped(){
- $this->_test("count(*)", "count", 'count(*) as count');
- }
-
- function testUnqualifiedColumnExpressionWithOneParameterLessFunction(){
- $this->_test("substring(regdate)", NULL
- , 'substring('.$this->dbLeftEscapeChar.'regdate'.$this->dbRightEscapeChar.')');
- }
-
- function testAliasedUnqualifiedColumnExpressionWithOneParameterLessFunction(){
- $this->_test("substring(regdate)", "regdate"
- , 'substring('.$this->dbLeftEscapeChar.'regdate'.$this->dbRightEscapeChar.') as regdate');
- }
-
- function testQualifiedColumnExpressionWithOneParameterLessFunction(){
- $this->_test("substring(xe_member.regdate)", NULL
- , 'substring('.$this->dbLeftEscapeChar.'xe_member'.$this->dbRightEscapeChar.'.'.$this->dbLeftEscapeChar.'regdate'.$this->dbRightEscapeChar.')');
- }
-
- function testAliasedQualifiedColumnExpressionWithOneParameterLessFunction(){
- $this->_test("substring(xe_member.regdate)", "regdate"
- , 'substring('.$this->dbLeftEscapeChar.'xe_member'.$this->dbRightEscapeChar.'.'.$this->dbLeftEscapeChar.'regdate'.$this->dbRightEscapeChar.') as regdate');
- }
-
- function testUnqualifiedColumnExpressionWithTwoParameterLessFunctions(){
- $this->_test("lpad(rpad(regdate))", NULL
- , 'lpad(rpad('.$this->dbLeftEscapeChar.'regdate'.$this->dbRightEscapeChar.'))');
- }
-
- function testAliasedUnqualifiedColumnExpressionWithTwoParameterLessFunctions(){
- $this->_test("lpad(rpad(regdate))", "regdate"
- , 'lpad(rpad('.$this->dbLeftEscapeChar.'regdate'.$this->dbRightEscapeChar.')) as regdate');
- }
-
- function testQualifiedColumnExpressionWithTwoParameterLessFunctions(){
- $this->_test("lpad(rpad(xe_member.regdate))", NULL
- , 'lpad(rpad('.$this->dbLeftEscapeChar.'xe_member'.$this->dbRightEscapeChar.'.'.$this->dbLeftEscapeChar.'regdate'.$this->dbRightEscapeChar.'))');
- }
-
- function testAliasedQualifiedColumnExpressionWithTwoParameterLessFunctions(){
- $this->_test("lpad(rpad(xe_member.regdate))", "regdate"
- , 'lpad(rpad('.$this->dbLeftEscapeChar.'xe_member'.$this->dbRightEscapeChar.'.'.$this->dbLeftEscapeChar.'regdate'.$this->dbRightEscapeChar.')) as regdate');
- }
-
- function testColumnAddition(){
- $this->_test("score1 + score2", "total"
- , $this->dbLeftEscapeChar.'score1'.$this->dbRightEscapeChar.' + '.$this->dbLeftEscapeChar.'score2'.$this->dbRightEscapeChar.' as total');
- }
-
- function testMultipleParameterFunction(){
- $this->_test("substring(regdate, 1, 8)", NULL
- , 'substring('.$this->dbLeftEscapeChar.'regdate'.$this->dbRightEscapeChar.', 1, 8)');
- $this->_test("substring(regdate, 1, 8)", "regdate"
- , 'substring('.$this->dbLeftEscapeChar.'regdate'.$this->dbRightEscapeChar.', 1, 8) as regdate');
- $this->_test("substring(xe_member.regdate, 1, 8)", NULL
- , 'substring('.$this->dbLeftEscapeChar.'xe_member'.$this->dbRightEscapeChar.'.'.$this->dbLeftEscapeChar.'regdate'.$this->dbRightEscapeChar.', 1, 8)');
- }
-
- function testFunctionAddition(){
- $this->_test("abs(score) + abs(totalscore)", NULL
- , 'abs('.$this->dbLeftEscapeChar.'score'.$this->dbRightEscapeChar.') + abs('.$this->dbLeftEscapeChar.'totalscore'.$this->dbRightEscapeChar.')');
- }
- }
diff --git a/tests/classes/db/db/MockDb.php b/tests/classes/db/db/MockDb.php
deleted file mode 100644
index 009dbff21..000000000
--- a/tests/classes/db/db/MockDb.php
+++ /dev/null
@@ -1,82 +0,0 @@
- */
-
- /**
- * @brief Mock database base class
- *
- * Used to load mock classes instead of actual ones,
- * so that connect methods can be skipped
- */
- class MockDb extends DB {
-
- function &getParser($force = false){
- static $dbParser = null;
- if(!$dbParser || $force) {
- $oDB = &MockDb::getInstance();
- $dbParser = $oDB->getParser();
- DB::getParser(true);
- }
-
- return $dbParser;
- }
-
- function &getInstance(){
- $db_type = Context::getDBType();
-
- if(!isset($GLOBALS['__DB__'])) $GLOBALS['__DB__'] = array();
- if(!isset($GLOBALS['__DB__'][$db_type])) {
- switch($db_type){
- case 'mssql' :
- $GLOBALS['__DB__'][$db_type] = new MockDBMssql; break;
- case 'mysql' :
- $GLOBALS['__DB__'][$db_type] = new MockDBMysql; break;
- case 'cubrid' :
- $GLOBALS['__DB__'][$db_type] = new MockDBCubrid; break;
- }
- }
-
- return $GLOBALS['__DB__'][$db_type];
- }
- }
-
- /**
- * @brief Mock up for MS SQL class
- *
- * Overrides default constructor in order to skip connect method
- */
- class MockDBMssql extends DBMssql {
- function MockDBMssql(){
- $this->_setDBInfo();
- }
- }
-
- /**
- * @brief Mock up for CUBRID class
- *
- * Overrides default constructor in order to skip connect method
- */
- class MockDBCubrid extends DBCubrid {
- function MockDBCubrid(){
- $this->_setDBInfo();
- }
- }
-
- /**
- * @brief Mock up for Mysql class
- *
- * Overri des default constructor in order to skip connect method.
- */
- class MockDBMysql extends DBMysql {
- function MockDBMysql(){
- $this->_setDBInfo();
- }
-
- /**
- * Overrides mysql_real_escape_string, that returns null when no connection is present
- */
- function addQuotes($string){
- return $string;
- }
- }
-
-?>
diff --git a/tests/classes/db/db/MssqlOnlineTest.php b/tests/classes/db/db/MssqlOnlineTest.php
deleted file mode 100644
index 497f6e1a7..000000000
--- a/tests/classes/db/db/MssqlOnlineTest.php
+++ /dev/null
@@ -1,50 +0,0 @@
- */
-
- /**
- * Base class for tests for MSSQL SQL syntax
- */
-
- class MssqlOnlineTest extends PHPUnit_Framework_TestCase {
-
- protected $backupGlobals = FALSE;
- protected $backupStaticAttributes = FALSE;
- protected $preserveGlobalState = FALSE;
-
- /**
- * Prepare runtime context - tell DB class that current DB is MSSQL
- */
- protected function setUp() {
- $this->markTestSkipped();
- $oContext = &Context::getInstance();
-
- $db_info->master_db = array('db_type' => 'mssql'
- ,'db_port' => '3306'
- ,'db_hostname' => 'PHENOMII\SQL2008EXPRESS'
- ,'db_userid' => 'dba'
- ,'db_password' => 'arniarules'
- ,'db_database' => 'xe-15-db'
- ,'db_table_prefix' => 'xe_');
- $db_info->slave_db = array(array('db_type' => 'mssql'
- ,'db_port' => '3306'
- ,'db_hostname' => 'PHENOMII\SQL2008EXPRESS'
- ,'db_userid' => 'dba'
- ,'db_password' => 'arniarules'
- ,'db_database' => 'xe-15-db'
- ,'db_table_prefix' => 'xe_'));
- $oContext->setDbInfo($db_info);
-
- // remove cache dir
- FileHandler::removeDir( _XE_PATH_ . 'files/cache');
-
- DB::getParser(true);
- }
-
- /**
- * Free resources - reset static DB and QueryParser
- */
- protected function tearDown() {
- unset($GLOBALS['__DB__']);
- }
- }
-?>
diff --git a/tests/classes/db/db/MssqlTest.php b/tests/classes/db/db/MssqlTest.php
deleted file mode 100644
index 1f09ed99b..000000000
--- a/tests/classes/db/db/MssqlTest.php
+++ /dev/null
@@ -1,27 +0,0 @@
- */
-
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
- class MssqlTest extends DBTest {
-
- protected function setUp() {
- $oContext = &Context::getInstance();
-
- $db_info->master_db = array('db_type' => 'mssql','db_table_prefix' => 'xe_');
- $db_info->slave_db = array(array('db_type' => 'mssql','db_table_prefix' => 'xe_'));
-
- $oContext->setDbInfo($db_info);
-
- $db = new MockDb();
- $db->getParser(true);
- }
-
- protected function tearDown() {
- unset($GLOBALS['__DB__']);
- }
- }
-?>
diff --git a/tests/classes/db/db/MysqlTest.php b/tests/classes/db/db/MysqlTest.php
deleted file mode 100644
index c78e857b3..000000000
--- a/tests/classes/db/db/MysqlTest.php
+++ /dev/null
@@ -1,32 +0,0 @@
- */
-
- /**
- * Base class for tests for Mysql SQL syntax
- */
-
- class MysqlTest extends DBTest {
-
- /**
- * Prepare runtime context - tell DB class that current DB is CUBRID
- */
- protected function setUp() {
- $oContext = &Context::getInstance();
-
- $db_info->master_db = array('db_type' => 'mysql','db_table_prefix' => 'xe_');
- $db_info->slave_db = array(array('db_type' => 'mysql','db_table_prefix' => 'xe_'));
-
- $oContext->setDbInfo($db_info);
-
- $db = new MockDb();
- $db->getParser(true);
- }
-
- /**
- * Free resources - reset static DB and QueryParser
- */
- protected function tearDown() {
- unset($GLOBALS['__DB__']);
- }
- }
-?>
diff --git a/tests/classes/db/db/SqliteTest.php b/tests/classes/db/db/SqliteTest.php
deleted file mode 100644
index b1916b921..000000000
--- a/tests/classes/db/db/SqliteTest.php
+++ /dev/null
@@ -1,33 +0,0 @@
- */
-
- /**
- * Base class for tests for Sqlite SQL syntax
- *
- * See syntax reference:
- * http://www.sqlite.org/lang.html
- */
-
- class SqliteTest extends DBTest {
-
- /**
- * Prepare runtime context - tell DB class that current DB is CUBRID
- */
- protected function setUp() {
- $oContext = &Context::getInstance();
-
- $db_info->master_db = array('db_type' => 'sqlite3_pdo','db_table_prefix' => 'xe_');
- $db_info->slave_db = array(array('db_type' => 'sqlite3_pdo','db_table_prefix' => 'xe_'));
-
- $oContext->setDbInfo($db_info);
- DB::getParser(true);
- }
-
- /**
- * Free resources - reset static DB and QueryParser
- */
- protected function tearDown() {
- unset($GLOBALS['__DB__']);
- }
- }
-?>
diff --git a/tests/classes/db/db/xml_query/cubrid/CubridDeleteTest.php b/tests/classes/db/db/xml_query/cubrid/CubridDeleteTest.php
deleted file mode 100644
index 0e9bc8ec1..000000000
--- a/tests/classes/db/db/xml_query/cubrid/CubridDeleteTest.php
+++ /dev/null
@@ -1,21 +0,0 @@
- */
-
- class CubridDeleteTest extends CubridTest {
-
- function _test($xml_file, $argsString, $expected){
- $this->_testQuery($xml_file, $argsString, $expected, 'getDeleteSql');
- }
-
- function test_module_deleteActionForward(){
- $xml_file = _XE_PATH_ . "modules/module/queries/deleteActionForward.xml";
- $argsString = '$args->module = "page";
- $args->type = "page";
- $args->act = "tata";';
- $expected = 'delete "action_forward" from "xe_action_forward" as "action_forward"
- where "module" = \'page\'
- and "type" = \'page\'
- and "act" = \'tata\'';
- $this->_test($xml_file, $argsString, $expected);
- }
- }
diff --git a/tests/classes/db/db/xml_query/cubrid/CubridIndexHintTest.php b/tests/classes/db/db/xml_query/cubrid/CubridIndexHintTest.php
deleted file mode 100644
index 78552090a..000000000
--- a/tests/classes/db/db/xml_query/cubrid/CubridIndexHintTest.php
+++ /dev/null
@@ -1,86 +0,0 @@
- */
-
- class CubridIndexHintTest extends CubridTest {
- var $xmlPath = 'data/';
-
- function CubridIndexHintTest(){
- $this->xmlPath = str_replace('CubridIndexHintTest.php', '', str_replace('\\', '/', __FILE__)) . $this->xmlPath;
- }
-
- function _test($xml_file, $argsString, $expected){
- var_dump($xml_file);
- $this->_testQuery($xml_file, $argsString, $expected, 'getSelectSql');
- }
-
- function testOneUseIndexHintAndOneTable(){
- $xml_file = $this->xmlPath . "one_index_hint_one_table.xml";
- $argsString = '';
- $expected = 'select * from "xe_member" as "member" using index "member"."xe_idx_member_list_order"';
- $this->_test($xml_file, $argsString, $expected);
- }
-
-
- function testTwoUseIndexHintsAndOneTable(){
- $xml_file = $this->xmlPath . "two_index_hints_one_table.xml";
- $argsString = '';
- $expected = 'select * from "xe_member" as "member" using index "member"."xe_idx_member_list_order", "member"."xe_idx_member_srl"';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testThreeUseIndexHintsAndTwoTables(){
- $xml_file = $this->xmlPath . "three_index_hints_two_tables.xml";
- $argsString = '';
- $expected = 'select * from "xe_member" as "member", "xe_document" as "document"
- using index "member"."xe_idx_member_list_order", "member"."xe_idx_member_srl", "document"."xe_idx_document_srl"';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testThreeUseIndexHintsAndTwoTablesCombined(){
- $xml_file = $this->xmlPath . "three_index_hints_two_tables_combined.xml";
- $argsString = '';
- $expected = 'select * from "xe_member" as "member", "xe_document" as "document"
- using index "member"."xe_idx_member_list_order", "member"."xe_idx_member_srl"(+), "document"."xe_idx_document_srl"';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testIgnoreIndexHintIsSkipped(){
- $xml_file = $this->xmlPath . "ignore_index_hint.xml";
- $argsString = '';
- $expected = 'select * from "xe_member" as "member"';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testMysqlIndexHintIsSkipped(){
- $xml_file = $this->xmlPath . "mysql_index_hint.xml";
- $argsString = '';
- $expected = 'select * from "xe_member" as "member"';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- /**
- * If CUBRID database is used, indexes are created with prefix.
- *
- * e.g.: xe_indx_list_order
- */
- function testPrefixIsAddedToIndexName(){
- $xml_file = $this->xmlPath . "one_index_hint_one_table.xml";
- $argsString = '';
- $expected = 'select * from "xe_member" as "member" using index "member"."xe_idx_member_list_order"';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- /**
- * Tests that index is added if "for" attribute is "ALL"
- *
- * example: ...
- */
- function testIndexHintForAll(){
- $xml_file = $this->xmlPath . "index_hint_for_all.xml";
- $argsString = '';
- $expected = 'select * from "xe_member" as "member" using index "member"."xe_idx_member_list_order"';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- }
-?>
diff --git a/tests/classes/db/db/xml_query/cubrid/CubridInsertOnlineTest.php b/tests/classes/db/db/xml_query/cubrid/CubridInsertOnlineTest.php
deleted file mode 100644
index 5ce67752e..000000000
--- a/tests/classes/db/db/xml_query/cubrid/CubridInsertOnlineTest.php
+++ /dev/null
@@ -1,86 +0,0 @@
- */
-
- class CubridInsertOnlineTest extends CubridOnlineTest {
-
- /**
- * Note: this test can fail when comaparing regdate from the $args with
- * regdate from the expected string - a few seconds difference
- */
- function test_module_insertModule_escapeContent(){
- $xml_file = _XE_PATH_ . "modules/module/queries/insertModule.xml";
-
- $args->module_category_srl = 0;
- $args->browser_title = "test";
- $args->layout_srl = 0;
- $args->mlayout_srl = 0;
- $args->module = "page";
- $args->mid = "test";
- $args->site_srl = 0;
- $args->module_srl = 47374;
- $args->content = "hello \' moto";
-
- $output = executeQuery('module.insertModule', $args);
-
- $this->assertTrue(!$output->error, $output->message);
- }
-
- function test_document_insertDocument_defaultVarcharValue(){
- $args->module_srl = 102;
- $args->content = 'yuhuuuuu
';
- $args->document_srl = 9200;
- $args->is_secret = 'N';
- $args->allow_comment = 'N';
- $args->lock_comment = 'N';
- $args->allow_trackback = 'N';
- $args->notify_message = 'N';
- $args->ipaddress = '127.0.0.1';
- $args->extra_vars = 'N;';
- $args->readed_count = 0;
- $args->list_order = -9201;
- $args->update_order = -9201;
- $args->member_srl = 4;
- $args->user_id = 'admin';
- $args->user_name = 'admin';
- $args->nick_name = 'admin';
- $args->email_address = 'admin@admin.admin';
- $args->homepage = '';
- $args->title = 'yuhuu';
- $args->lang_code;
- $output = executeQuery('document.insertDocument', $args);
-
- $this->assertNotEquals(-225, $output->error);
- $this->assertNotEquals('Missing value for attribute "homepage" with the NOT NULL constraint.', $output->message);
- }
-
- function test_communication_addFriendGroup(){
- $args->member_srl = 202;
- $args->title = "Grup";
-
- $output = executeQuery("communication.addFriendGroup", $args);
- $this->assertEquals(0, $output->error, $output->message);
-
- }
-
- function test_communication_addFriendGroup_NullId(){
- $args->member_srl = 202;
- $args->title = "Grup";
- $args->friend_group_srl = trim(null);
-
- $output = executeQuery("communication.addFriendGroup", $args);
- $this->assertEquals(0, $output->error, $output->message);
-
- }
-
- protected function tearDown() {
- $db = &DB::getInstance();
- $db->_query("DELETE FROM xe_modules WHERE module_srl = 47374");
- $db->_query("DELETE FROM xe_documents WHERE document_srl = 9200");
- $db->_query("DELETE FROM xe_member_friend_group WHERE member_srl = 202");
- $db->close();
-
- parent::tearDown();
- }
-
-
- }
diff --git a/tests/classes/db/db/xml_query/cubrid/CubridInsertTest.php b/tests/classes/db/db/xml_query/cubrid/CubridInsertTest.php
deleted file mode 100644
index 204726450..000000000
--- a/tests/classes/db/db/xml_query/cubrid/CubridInsertTest.php
+++ /dev/null
@@ -1,128 +0,0 @@
- */
-
- class CubridInsertTest extends CubridTest {
-
- function _test($xml_file, $argsString, $expected){
- $this->_testQuery($xml_file, $argsString, $expected, 'getInsertSql');
- }
-
-
- /**
- * Note: this test can fail when comaparing regdate from the $args with
- * regdate from the expected string - a few seconds difference
- */
- function test_module_insertModule(){
- $xml_file = _XE_PATH_ . "modules/module/queries/insertModule.xml";
- $argsString = ' $args->module_category_srl = 0;
- $args->browser_title = "test";
- $args->layout_srl = 0;
- $args->mlayout_srl = 0;
- $args->module = "page";
- $args->mid = "test";
- $args->site_srl = 0;
- $args->module_srl = 47374;';
- $expected = 'insert into "xe_modules"
- ("site_srl"
- , "module_srl"
- , "module_category_srl"
- , "mid"
- , "browser_title"
- , "layout_srl"
- , "module"
- , "is_default"
- , "open_rss"
- , "regdate"
- , "mlayout_srl"
- , "use_mobile")
- values
- (0
- , 47374
- , 0
- , \'test\'
- , \'test\'
- , 0
- , \'page\'
- , \'n\'
- , \'y\'
- , \''.date("YmdHis").'\'
- , 0
- , \'n\')';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_module_insertSiteTodayStatus(){
- //\''.date("YmdHis").'\'
- $xml_file = _XE_PATH_ . "modules/counter/queries/insertTodayStatus.xml";
- $argsString = ' $args->regdate = 0;
- $args->unique_visitor = 0;
- $args->pageview = 0;';
- $expected = 'insert into "xe_counter_status"
- ("regdate"
- , "unique_visitor"
- , "pageview")
- values
- ('.date("YmdHis").'
- , 0
- , 0)';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_module_insertCounterLog(){
- $xml_file = _XE_PATH_ . "modules/counter/queries/insertCounterLog.xml";
- $argsString = ' $args->site_srl = 0;
- $args->regdate = "20110607120619";
- $args->ipaddress = "127.0.0.1";
- $args->user_agent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.77 Safari/534.24";';
- $expected = 'insert into "xe_counter_log"
- ("site_srl", "regdate", "ipaddress", "user_agent")
- VALUES (0, \'20110607120619\', \'127.0.0.1\', \'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.77 Safari/534.24\')
- ';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_module_insertMember(){
- $xml_file = _XE_PATH_ . "modules/member/queries/insertMember.xml";
- $argsString = ' $args->member_srl = 203;
- $args->user_id = "cacao";
- $args->email_address = "teta@ar.ro";
- $args->password = "23e5484cb88f3c07bcce2920a5e6a2a7";
- $args->email_id = "teta";
- $args->email_host = "ar.ro";
- $args->user_name = "trident";
- $args->nick_name = "aloha";
- $args->homepage = "http://jkgjfk./ww";
- $args->allow_mailing = "Y";
- $args->allow_message = "Y";
- $args->denied = "N";
- $args->regdate = "20110607121952";
- $args->change_password_date = "20110607121952";
- $args->last_login = "20110607121952";
- $args->is_admin = "N";
- $args->extra_vars = "O:8:\"stdClass\":2:{s:4:\"body\";s:0:\"\";s:7:\"_filter\";s:6:\"insert\";}";
- $args->list_order = -203;
- ';
- $expected = 'INSERT INTO "xe_member"
- ("member_srl", "user_id", "email_address", "password", "email_id", "email_host", "user_name", "nick_name",
- "homepage", "allow_mailing", "allow_message", "denied", "regdate", "change_password_date",
- "last_login", "is_admin", "extra_vars", "list_order")
- VALUES (203, \'cacao\', \'teta@ar.ro\', \'23e5484cb88f3c07bcce2920a5e6a2a7\', \'teta\', \'ar.ro\', \'trident\',
- \'aloha\', \'http://jkgjfk./ww\', \'Y\', \'Y\', \'N\', \'20110607121952\', \'20110607121952\',
- \'20110607121952\', \'N\', \'O:8:"stdClass":2:{s:4:"body";s:0:"";s:7:"_filter";s:6:"insert";}\', -203)';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_module_insertModuleExtraVars(){
- $xml_file = _XE_PATH_ . "modules/module/queries/insertModuleExtraVars.xml";
- $argsString = ' $args->module_srl = 202;
- $args->name = "_filter";
- $args->value = "insert_page";
- ';
- $expected = 'INSERT INTO "xe_module_extra_vars"
- ("module_srl", "name", "value")
- VALUES (202, \'_filter\', \'insert_page\')
- ';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- }
diff --git a/tests/classes/db/db/xml_query/cubrid/CubridSelectOnlineTest.php b/tests/classes/db/db/xml_query/cubrid/CubridSelectOnlineTest.php
deleted file mode 100644
index 6d4abb679..000000000
--- a/tests/classes/db/db/xml_query/cubrid/CubridSelectOnlineTest.php
+++ /dev/null
@@ -1,77 +0,0 @@
- */
-
- class CubridSelectOnlineTest extends CubridOnlineTest {
-
- function test_get_module_by_mid(){
- $args->mid = 'test_4l8ci4vv0n';
- $args->site_srl = 0;
- $output = executeQuery('module.getMidInfo', $args);
- $this->assertNotNull($output);
- $this->assertNotNull($output->data, $output->message . PHP_EOL . $output->variables["_query"]);
- $this->assertEquals($output->data->module_srl, 111);
- }
-
- /**
- * Tests that when a column list is given, the query only selects those columns from the database
- * insetad of retrieving all table columns (as specified in the xml query file)
- */
- function test_get_module_by_mid_columnList(){
- $args->mid = 'test_4l8ci4vv0n';
- $args->site_srl = 0;
- $output = executeQuery('module.getMidInfo', $args, array('module_srl'));
- $this->assertNotNull($output);
- $this->assertNotNull($output->data, $output->message . PHP_EOL . $output->variables["_query"]);
- $this->assertEquals($output->data->module_srl, 111);
- $this->assertEquals($output->data->module, null);
- }
-
- function test_module_getInfo(){
- $args->site_srl = 0;
- $output = executeQuery('module.getSiteInfo', $args);
- $this->assertTrue(is_a($output, 'Object'));
- $this->assertEquals(0, $output->error, $output->message . PHP_EOL . $output->variables["_query"]);
- }
-
- function test_document_getDocumentList_pagination(){
- $args->sort_index = 'list_order';
- $args->order_type = 'asc';
- $args->page = 1;
- $args->list_count = 30;
- $args->page_count = 10;
- $args->s_member_srl = 4;
-
- $output = executeQuery('document.getDocumentList', $args);
- $this->assertEquals(0, $output->error, $output->message . PHP_EOL . $output->variables["_query"]);
- }
-
- function test_syndication_getDocumentList(){
- $args->module_srl = NULL;
- $args->exclude_module_srl = NULL;
- $args->category_srl = NULL;
- $args->sort_index = 'list_order';
- $args->order_type = 'asc';
- $args->page = 5;
- $args->list_count = 30;
- $args->page_count = 10;
- $args->start_date = NULL;
- $args->end_date = NULL;
- $args->member_srl = NULL;
- $output = executeQuery('document.getDocumentList', $args);
-
- $this->assertTrue(is_int($output->page), $output->message . PHP_EOL . $output->variables["_query"]);
- }
-
- function test_member_getMemberList(){
- $args->is_admin = '';
- $args->is_denied = '';
- $args->sort_index = "list_order";
- $args->sort_order = 'asc';
- $args->list_count = 40;
- $args->page_count = 10;
-
- $output = executeQuery('member.getMemberList', $args);
- $this->assertEquals(0, $output->error, $output->message . PHP_EOL . $output->variables["_query"]);
- }
- }
-?>
diff --git a/tests/classes/db/db/xml_query/cubrid/CubridSelectTest.php b/tests/classes/db/db/xml_query/cubrid/CubridSelectTest.php
deleted file mode 100644
index bd439956f..000000000
--- a/tests/classes/db/db/xml_query/cubrid/CubridSelectTest.php
+++ /dev/null
@@ -1,456 +0,0 @@
- */
-
- class CubridSelectTest extends CubridTest {
-
- function _test($xml_file, $argsString, $expected, $columnList = null){
- $this->_testQuery($xml_file, $argsString, $expected, 'getSelectSql', $columnList);
- }
-
- function testSelectStar(){
- $xml_file = _XE_PATH_ . "modules/module/queries/getAdminId.xml";
- $argsString = '$args->module_srl = 10;';
- $expected = 'SELECT * FROM "xe_module_admins" as "module_admins" , "xe_member" as "member" WHERE "module_srl" = 10 and "member"."member_srl" = "module_admins"."member_srl"';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testRequiredParameter(){
- $xml_file = _XE_PATH_ . "modules/module/queries/getAdminId.xml";
- $argsString = '';
- $expected = 'Date incorecte! Query-ul nu a putut fi executat.';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testWithoutCategoriesTag(){
- $xml_file = _XE_PATH_ . "modules/module/queries/getModuleCategories.xml";
- $argsString = '';
- $expected = 'SELECT * FROM "xe_module_categories" as "module_categories" ORDER BY "title" asc';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_module_getDefaultModules(){
- $xml_file = _XE_PATH_ . "modules/module/queries/getDefaultModules.xml";
- $argsString = '$args->site_srl = 0;';
- $expected = 'SELECT "modules"."site_srl"
- , "modules"."module"
- , "modules"."mid"
- , "modules"."browser_title"
- , "module_categories"."title" as "category"
- , "modules"."module_srl"
- FROM "xe_modules" as "modules"
- left join "xe_module_categories" as "module_categories"
- on "module_categories"."module_category_srl" = "modules"."module_category_srl"
- WHERE "modules"."site_srl" = 0
- ORDER BY "modules"."module" asc, "module_categories"."title" asc, "modules"."mid" asc';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_module_getSiteInfo(){
- $xml_file = _XE_PATH_ . "modules/module/queries/getSiteInfo.xml";
- $argsString = '$args->site_srl = 0;';
- $expected = 'SELECT "modules"."site_srl" as "module_site_srl"
- , "modules"."module_srl" as "module_srl"
- , "modules"."module" as "module"
- , "modules"."module_category_srl" as "module_category_srl"
- , "modules"."layout_srl" as "layout_srl"
- , "modules"."mlayout_srl" as "mlayout_srl"
- , "modules"."use_mobile" as "use_mobile"
- , "modules"."menu_srl" as "menu_srl"
- , "modules"."mid" as "mid"
- , "modules"."skin" as "skin"
- , "modules"."mskin" as "mskin"
- , "modules"."browser_title" as "browser_title"
- , "modules"."description" as "description"
- , "modules"."is_default" as "is_default"
- , "modules"."content" as "content"
- , "modules"."mcontent" as "mcontent"
- , "modules"."open_rss" as "open_rss"
- , "modules"."header_text" as "header_text"
- , "modules"."footer_text" as "footer_text"
- , "modules"."regdate" as "regdate"
- , "sites"."site_srl" as "site_srl"
- , "sites"."domain" as "domain"
- , "sites"."index_module_srl" as "index_module_srl"
- , "sites"."default_language" as "default_language"
- FROM "xe_sites" as "sites"
- left join "xe_modules" as "modules" on "modules"."module_srl" = "sites"."index_module_srl"
- WHERE "sites"."site_srl" = 0 ';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_addon_getAddonInfo(){
- $xml_file = _XE_PATH_ . "modules/addon/queries/getAddonInfo.xml";
- $argsString = '$args->addon = "captcha";';
- $expected = 'SELECT *
- FROM "xe_addons" as "addons"
- WHERE "addon" = \'captcha\' ';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_addon_getAddons(){
- $xml_file = _XE_PATH_ . "modules/addon/queries/getAddons.xml";
- $argsString = '';
- $expected = 'SELECT *
- FROM "xe_addons" as "addons"
- ORDER BY "addon" asc';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_admin_getCommentCount(){
- $xml_file = _XE_PATH_ . "modules/admin/queries/getCommentCount.xml";
- $argsString = '';
- $expected = 'SELECT count(*) as "count"
- FROM "xe_comments" as "comments"';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_admin_getCommentDeclaredStatus(){
- $xml_file = _XE_PATH_ . "modules/admin/queries/getCommentDeclaredStatus.xml";
- $argsString = '$args->date = "20110411";';
- $expected = 'SELECT substr("regdate",1,8) as "date", count(*) as "count"
- FROM "xe_comment_declared_log" as "comment_declared_log"
- WHERE "regdate" >= \'20110411\'
- GROUP BY substr("regdate",1,8)
- ORDER BY substr("regdate",1,8) asc limit 2';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_member_getAutoLogin(){
- $xml_file = _XE_PATH_ . "modules/member/queries/getAutoLogin.xml";
- $argsString = '$args->autologin_key = 10;';
- $expected = 'SELECT "member"."user_id" as "user_id"
- , "member"."password" as "password"
- , "member_autologin"."autologin_key" as "autologin_key"
- FROM "xe_member" as "member" , "xe_member_autologin" as "member_autologin"
- WHERE "member_autologin"."autologin_key" = \'10\'
- and "member"."member_srl" = "member_autologin"."member_srl"';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_opage_getOpageList(){
- $xml_file = _TEST_PATH_ . "db/xml_query/cubrid/data/opage.getOpageList.xml";
- $argsString = '$args->s_title = "yuhuu";
- $args->module = \'opage\';';
- $expected = 'SELECT *
- FROM "xe_modules" as "modules"
- WHERE "module" = \'opage\' and ("title" like \'%yuhuu%\')
- ORDER BY "module_srl" desc
- LIMIT 0, 20';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_syndication_getGrantedModules(){
- $xml_file = _TEST_PATH_ . "db/xml_query/cubrid/data/syndication.getGrantedModules.xml";
- $argsString = '$args->module_srl = 12;
- $args->name = array(\'access\',\'view\',\'list\');';
- $expected = 'select "module_srl"
- from "xe_module_grants" as "module_grants"
- where "name" in (\'access\',\'view\',\'list\')
- and ("group_srl" >= 1
- or "group_srl" = -1
- or "group_srl" = -2)
- group by "module_srl"';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_document_getDocumentList(){
- $xml_file = _XE_PATH_ . "modules/document/queries/getDocumentList.xml";
- $argsString = '$args->sort_index = \'list_order\';
- $args->order_type = \'asc\';
- $args->page = 1;
- $args->list_count = 30;
- $args->page_count = 10;
- $args->s_member_srl = 4;';
- $expected = 'select *
- from "xe_documents" as "documents"
- where ("member_srl" = 4)
- and "list_order" <= 2100000000
- order by "list_order" asc
- limit 0, 30';
- $this->_test($xml_file, $argsString, $expected);
-
-
- }
-
- /**
- * Test column list
- */
- function test_session_getSession(){
- $xml_file = _XE_PATH_ . "modules/session/queries/getSession.xml";
- $argsString = '$args->session_key = \'session_key\';';
- $columnList = array('session_key', 'cur_mid', 'val');
-
- $expected = 'select "session_key", "cur_mid", "val"
- from "xe_session" as "session"
- where "session_key" = \'session_key\'';
-
- $this->_test($xml_file, $argsString, $expected, $columnList);
- }
-
- function test_module_getModuleInfoByDocument(){
- $xml_file = _XE_PATH_ . "modules/module/queries/getModuleInfoByDocument.xml";
- $argsString = '$args->document_srl = 10;';
- $expected = 'SELECT "modules".*
- FROM "xe_modules" as "modules"
- , "xe_documents" as "documents"
- WHERE "documents"."document_srl" = 10
- and "modules"."module_srl" = "documents"."module_srl"';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_member_getMemberList(){
- $xml_file = _XE_PATH_ . "modules/member/queries/getMemberList.xml";
- $argsString = '$args->is_admin = \'\';
- $args->is_denied = \'\';
- $args->sort_index = "list_order";
- $args->sort_order = \'asc\';
- $args->list_count = 40;
- $args->page_count = 10;';
- $expected = 'select *
- from "xe_member" as "member"
- where "list_order" <= 2100000000
- order by "list_order" asc
- limit 0, 40';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- /**
- * Tests "not in" query condition
- * Query argument is a single value - not in (12)
- */
- function test_module_getModules_Notin_Single_Value(){
- $xml_file = _TEST_PATH_ . "db/xml_query/cubrid/data/syndication.getModules.xml";
- $argsString = '$args->except_module_srls = 12;';
- $expected = 'select "modules"."site_srl" as "site_srl"
- , "modules"."module_srl" as "module_srl"
- , "sites"."domain" as "domain"
- , "modules"."mid" as "mid"
- , "modules"."module" as "module"
- , "modules"."browser_title" as "browser_title"
- , "modules"."description" as "description"
- from "xe_sites" as "sites"
- , "xe_modules" as "modules"
- left join "xe_syndication_except_modules" as "except_modules"
- on "modules"."module_srl" = "except_modules"."module_srl"
- where "modules"."module_srl" not in (12)
- and "sites"."site_srl" = "modules"."site_srl"
- and "except_modules"."module_srl" is null';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_module_getModules_Notin_Multiple_Value_String(){
- $xml_file = _TEST_PATH_ . "db/xml_query/cubrid/data/syndication.getModules.xml";
- $argsString = '$args->except_module_srls = "12, 13, 14";';
- $expected = 'select "modules"."site_srl" as "site_srl"
- , "modules"."module_srl" as "module_srl"
- , "sites"."domain" as "domain"
- , "modules"."mid" as "mid"
- , "modules"."module" as "module"
- , "modules"."browser_title" as "browser_title"
- , "modules"."description" as "description"
- from "xe_sites" as "sites"
- , "xe_modules" as "modules"
- left join "xe_syndication_except_modules" as "except_modules"
- on "modules"."module_srl" = "except_modules"."module_srl"
- where "modules"."module_srl" not in (12,13,14)
- and "sites"."site_srl" = "modules"."site_srl"
- and "except_modules"."module_srl" is null';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_module_getModules_Notin_Multiple_Value_Array(){
- $xml_file = _TEST_PATH_ . "db/xml_query/cubrid/data/syndication.getModules.xml";
- $argsString = '$args->except_module_srls = array(12, 13, 14);';
- $expected = 'select "modules"."site_srl" as "site_srl"
- , "modules"."module_srl" as "module_srl"
- , "sites"."domain" as "domain"
- , "modules"."mid" as "mid"
- , "modules"."module" as "module"
- , "modules"."browser_title" as "browser_title"
- , "modules"."description" as "description"
- from "xe_sites" as "sites"
- , "xe_modules" as "modules"
- left join "xe_syndication_except_modules" as "except_modules"
- on "modules"."module_srl" = "except_modules"."module_srl"
- where "modules"."module_srl" not in (12,13,14)
- and "sites"."site_srl" = "modules"."site_srl"
- and "except_modules"."module_srl" is null';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_module_getModules_In_Single_Value(){
- $xml_file = _TEST_PATH_ . "db/xml_query/cubrid/data/syndication.getModules.xml";
- $argsString = '$args->module_srls = 12;';
- $expected = 'select "modules"."site_srl" as "site_srl"
- , "modules"."module_srl" as "module_srl"
- , "sites"."domain" as "domain"
- , "modules"."mid" as "mid"
- , "modules"."module" as "module"
- , "modules"."browser_title" as "browser_title"
- , "modules"."description" as "description"
- from "xe_sites" as "sites"
- , "xe_modules" as "modules"
- left join "xe_syndication_except_modules" as "except_modules"
- on "modules"."module_srl" = "except_modules"."module_srl"
- where "modules"."module_srl" in (12)
- and "sites"."site_srl" = "modules"."site_srl"
- and "except_modules"."module_srl" is null';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_module_getModules_In_Multiple_Value_String(){
- $xml_file = _TEST_PATH_ . "db/xml_query/cubrid/data/syndication.getModules.xml";
- $argsString = '$args->module_srls = "12, 13, 14";';
- $expected = 'select "modules"."site_srl" as "site_srl"
- , "modules"."module_srl" as "module_srl"
- , "sites"."domain" as "domain"
- , "modules"."mid" as "mid"
- , "modules"."module" as "module"
- , "modules"."browser_title" as "browser_title"
- , "modules"."description" as "description"
- from "xe_sites" as "sites"
- , "xe_modules" as "modules"
- left join "xe_syndication_except_modules" as "except_modules"
- on "modules"."module_srl" = "except_modules"."module_srl"
- where "modules"."module_srl" in (12,13,14)
- and "sites"."site_srl" = "modules"."site_srl"
- and "except_modules"."module_srl" is null';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_module_getModules_In_Multiple_Value_Array(){
- $xml_file = _TEST_PATH_ . "db/xml_query/cubrid/data/syndication.getModules.xml";
- $argsString = '$args->module_srls = array(12, 13, 14);';
- $expected = 'select "modules"."site_srl" as "site_srl"
- , "modules"."module_srl" as "module_srl"
- , "sites"."domain" as "domain"
- , "modules"."mid" as "mid"
- , "modules"."module" as "module"
- , "modules"."browser_title" as "browser_title"
- , "modules"."description" as "description"
- from "xe_sites" as "sites"
- , "xe_modules" as "modules"
- left join "xe_syndication_except_modules" as "except_modules"
- on "modules"."module_srl" = "except_modules"."module_srl"
- where "modules"."module_srl" in (12,13,14)
- and "sites"."site_srl" = "modules"."site_srl"
- and "except_modules"."module_srl" is null';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_module_getModuleSrlByMid_In_Multiple_Value_Array_Strings(){
- $xml_file = _XE_PATH_ . "modules/module/queries/getModuleSrlByMid.xml";
- $argsString = '$args->mid = "\'mid1\', \'mid2\'";';
- $expected = 'select "module_srl" from "xe_modules" as "modules" where "mid" in (\'mid1\',\'mid2\')';
- $this->_test($xml_file, $argsString, $expected);
- }
-
-
- function test_file_getFileList_In_Empty_Array_Value(){
- $xml_file = _XE_PATH_ . "modules/file/queries/getFileList.xml";
- $argsString = '$args->exclude_module_srl = 12; $args->s_module_srl = array(); ';
- $expected = 'select "files".*
- from "xe_files" as "files"
- left join "xe_member" as "member" on "files"."member_srl" = "member"."member_srl"
- where "files"."module_srl" not in (12)
- order by "files"."file_srl" desc
- limit 0, 20';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_file_getFileList_Not_In_Empty_String_Value(){
- $xml_file = _XE_PATH_ . "modules/file/queries/getFileList.xml";
- $argsString = '$args->exclude_module_srl = ""; $args->s_module_srl = array(12); ';
- $expected = 'select "files".*
- from "xe_files" as "files"
- left join "xe_member" as "member" on "files"."member_srl" = "member"."member_srl"
- where "files"."module_srl" in (12)
- order by "files"."file_srl" desc
- limit 0, 20';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_document_getDeclaredList_In_Query(){
- $xml_file = _XE_PATH_ . "modules/document/queries/getDeclaredList.xml";
- $argsString = "\$args->list_count = 30;
- \$args->page_count = 10;
- \$args->sort_index = 'document_declared.declared_count';
- \$args->order_type = 'desc';";
- $expected = 'select * from "xe_documents" as "documents"
- , "xe_document_declared" as "document_declared"
- where "documents"."document_srl"
- in ("document_declared"."document_srl")
- order by "document_declared"."declared_count" desc
- limit 0, 30';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_getExpiredSession_curdate(){
- $xml_file = _XE_PATH_ . "modules/session/queries/getExpiredSessions.xml";
- $argsString = '';
- $expected = 'select "session_key"
- from "xe_session" as "session"
- where "expired" <= \'' . date("YmdHis") . '\'';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_rlike_1(){
- $xml_file = _TEST_PATH_ . "db/xml_query/cubrid/data/rlike1.xml";
- $argsString = '$args->title = "aaa";';
- $expected = 'select * from "xe_modules" as "modules" where "title" rlike \'aaa\'';
- define('__CUBRID_VERSION__', '8.4.1');
- $this->_test($xml_file, $argsString, $expected);
- }
-
-
- function test_resource_getLatestItem(){
- $xml_file = _TEST_PATH_ . "db/xml_query/cubrid/data/resource.getLatestItem.xml";
- $expected = 'SELECT "package"."module_srl" as "module_srl"
- , "package"."status" as "status"
- , "package"."category_srl" as "category_srl"
- , "package"."member_srl" as "member_srl"
- , "package"."package_srl" as "package_srl"
- , "package"."path" as "path"
- , "package"."license" as "license"
- , "package"."title" as "title"
- , "package"."homepage" as "homepage"
- , "package"."description" as "package_description"
- , "package"."voter" as "package_voter"
- , "package"."voted" as "package_voted"
- , "package"."downloaded" as "package_downloaded"
- , "package"."regdate" as "package_regdate"
- , "package"."last_update" as "package_last_update"
- , "member"."nick_name" as "nick_name"
- , "member"."user_id" as "user_id"
- , "item"."item_srl" as "item_srl"
- , "item"."document_srl" as "document_srl"
- , "item"."file_srl" as "item_file_srl"
- , "item"."screenshot_url" as "item_screenshot_url"
- , "item"."version" as "item_version"
- , "item"."voter" as "item_voter"
- , "item"."voted" as "item_voted"
- , "item"."downloaded" as "item_downloaded"
- , "item"."regdate" as "item_regdate"
- FROM "xe_resource_packages" as "package"
- , "xe_member" as "member"
- , "xe_resource_items" as "item"
- WHERE "package"."package_srl" = ?
- and "package"."member_srl" = "member"."member_srl"
- and "item"."item_srl" = "package"."latest_item_srl"';
- $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);
- }
-
- }
diff --git a/tests/classes/db/db/xml_query/cubrid/CubridSubqueryTest.php b/tests/classes/db/db/xml_query/cubrid/CubridSubqueryTest.php
deleted file mode 100644
index 42d5c59b0..000000000
--- a/tests/classes/db/db/xml_query/cubrid/CubridSubqueryTest.php
+++ /dev/null
@@ -1,192 +0,0 @@
- */
-
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
- class CubridSubqueryTest extends CubridTest {
- var $xmlPath = 'data/';
-
- function CubridSubqueryTest(){
- $this->xmlPath = str_replace('CubridSubqueryTest.php', '', str_replace('\\', '/', __FILE__)) . $this->xmlPath;
- }
-
- function _test($xml_file, $argsString, $expected){
- $this->_testQuery($xml_file, $argsString, $expected, 'getSelectSql');
- }
-
- function testSelectUncorrelated1(){
- $xml_file = $this->xmlPath . "select_uncorrelated1.xml";
- $argsString = '$args->user_id = 4;
- ';
- $expected = 'select "column_a" as "value_a"
- , (select max("column_b") as "count"
- from "xe_table_b" as "table_b"
- ) as "value_b"
- from "xe_table_a" as "table_a"
- where "column_a" = 4';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testSelectUncorrelated2(){
- $xml_file = $this->xmlPath . "select_uncorrelated2.xml";
- $argsString = '$args->user_id = 4;
- $args->user_name = 7;
- ';
- $expected = 'SELECT "column_a" as "value_a"
- , "column_b" as "value_b"
- , "column_c" as "value_c"
- , (SELECT max("column_b") as "count"
- FROM "xe_table_b" as "table_b"
- WHERE "column_ab" = 7) as "value_b"
- FROM "xe_table_a" as "table_a"
- WHERE "column_a" = 4';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testFromUncorrelated1(){
- $xml_file = $this->xmlPath . "from_uncorrelated1.xml";
- $argsString = '$args->user_id = 4;
- $args->user_name = 7;
- ';
- $expected = 'select max("documentcountbymember"."count") as "maxcount"
- from (
- select "member_srl" as "member_srl"
- , count(*) as "count"
- from "xe_documents" as "documents"
- group by "member_srl"
- ) as "documentcountbymember"';
- $this->_test($xml_file, $argsString, $expected);
- }
-
-// function testFromUncorrelated2(){
-// $xml_file = $this->xmlPath . "from_uncorrelated1.xml";
-// $argsString = '$args->user_id = 4;
-// $args->user_name = 7;
-// ';
-// $expected = 'select max("documentcountbymember"."count") as "maxcount"
-// from (
-// select "member_srl" as "member_srl"
-// , count(*) as "count"
-// from "xe_documents" as "documents"
-// group by "member_srl"
-// ) as "documentcountbymember"';
-// $this->_test($xml_file, $argsString, $expected);
-// }
-
- function testFromUncorrelated2(){
- $xml_file = $this->xmlPath . "from_uncorrelated2.xml";
- $argsString = '$args->member_srl = 4;
- $args->module_srl = 7;
- ';
- $expected = 'select max("documentcountbymember"."count") as "maxcount"
- from (
- select "member_srl" as "member_srl"
- , count(*) as "count"
- from "xe_documents" as "documents"
- where "module_srl" = 7
- group by "member_srl"
- ) as "documentcountbymember"
- where "member_srl" = 4
- ';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testSelectCorrelated1(){
- $xml_file = $this->xmlPath . "select_correlated1.xml";
- $argsString = '$args->user_id = 7;';
- $expected = 'select *,
- (select count(*) as "count"
- from "xe_documents" as "documents"
- where "documents"."user_id" = "member"."user_id"
- ) as "totaldocumentcount"
- from "xe_member" as "member"
- where "user_id" = \'7\'';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testSelectCorrelated2(){
- $xml_file = $this->xmlPath . "select_correlated2.xml";
- $argsString = '$args->user_id = 7;
- $args->module_srl = 17;
- ';
- $expected = 'select *,
- (select count(*) as "count"
- from "xe_documents" as "documents"
- where "documents"."user_id" = "member"."user_id"
- and "module_srl" = 17
- ) as "totaldocumentcount"
- from "xe_member" as "member"
- where "user_id" = \'7\'';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testWhereCorrelated1(){
- $xml_file = $this->xmlPath . "where_correlated1.xml";
- $argsString = '';
- $expected = 'select *
- from "xe_member" as "member"
- where "regdate" = (
- select max("regdate") as "maxregdate"
- from "xe_documents" as "documents"
- where "documents"."user_id" = "member"."user_id"
- )';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testWhereCorrelated2(){
- $xml_file = $this->xmlPath . "where_correlated2.xml";
- $argsString = '$args->module_srl = 12; $args->member_srl = 19;';
- $expected = 'select *
- from "xe_member" as "member"
- where "member_srl" = 19
- and "regdate" = (
- select max("regdate") as "maxregdate"
- from "xe_documents" as "documents"
- where "documents"."user_id" = "member"."user_id"
- and "module_srl" = 12
- )
- ';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testFromCorrelated1(){
- $xml_file = $this->xmlPath . "from_correlated1.xml";
- $argsString = '';
- $expected = 'select "m"."member_srl"
- , "m"."nickname"
- , "m"."regdate"
- , "a"."count"
- from (
- select "member_srl" as "member_srl"
- , count(*) as "count"
- from "xe_documents" as "documents"
- group by "member_srl"
- ) as "a"
- left join "xe_member" as "m" on "m"."member" = "a"."member_srl"';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testFromCorrelated2(){
- $xml_file = $this->xmlPath . "from_correlated2.xml";
- $argsString = '$args->module_srl = 12; $args->count = 20;';
- $expected = 'select "m"."member_srl"
- , "m"."nickname"
- , "m"."regdate"
- , "a"."count"
- from (
- select "member_srl" as "member_srl"
- , count(*) as "count"
- from "xe_documents" as "documents"
- where "module_srl" = 12
- group by "member_srl"
- ) as "a"
- left join "xe_member" as "m" on "m"."member" = "a"."member_srl"
- where "a"."count" >= 20
-';
- $this->_test($xml_file, $argsString, $expected);
- }
- }
-?>
diff --git a/tests/classes/db/db/xml_query/cubrid/CubridUpdateTest.php b/tests/classes/db/db/xml_query/cubrid/CubridUpdateTest.php
deleted file mode 100644
index 2f1012d4b..000000000
--- a/tests/classes/db/db/xml_query/cubrid/CubridUpdateTest.php
+++ /dev/null
@@ -1,98 +0,0 @@
- */
-
- class CubridUpdateTest extends CubridTest {
-
- function _test($xml_file, $argsString, $expected){
- $this->_testQuery($xml_file, $argsString, $expected, 'getUpdateSql');
- }
-
- function test_module_updateModule(){
- $xml_file = _XE_PATH_ . "modules/module/queries/updateModule.xml";
- $argsString = ' $args->module_category_srl = 0;
- $args->browser_title = "test";
- $args->layout_srl = 0;
- $args->mlayout_srl = 0;
- $args->module = "page";
- $args->mid = "test";
- $args->use_mobile = "";
- $args->site_srl = 0;
- $args->module_srl = 47374;';
- $expected = 'update "xe_modules" as "modules"
- set "module" = \'page\'
- , "module_category_srl" = 0
- , "layout_srl" = 0
- , "mid" = \'test\'
- , "browser_title" = \'test\'
- , "description" = \'\'
- , "is_default" = \'n\'
- , "open_rss" = \'y\'
- , "header_text" = \'\'
- , "footer_text" = \'\'
- , "mlayout_srl" = 0
- , "use_mobile" = \'n\'
- where "site_srl" = 0 and "module_srl" = 47374';
-// $expected = 'UPDATE "xe_modules" as "modules"
-// SET "module" = \'page\'
-// , "mid" = \'test\'
-// , "browser_title" = \'test\'
-// , "description" = \'\'
-// , "is_default" = \'N\'
-// , "open_rss" = \'Y\'
-// , "header_text" = \'\'
-// , "footer_text" = \'\'
-// , "use_mobile" = \'n\'
-// WHERE "site_srl" = 0
-// AND "module_srl" = 47374';
- $this->_test($xml_file, $argsString, $expected);
- }
- function test_member_updateLastLogin(){
- $xml_file = _XE_PATH_ . "modules/member/queries/updateLastLogin.xml";
- $argsString = ' $args->member_srl = 4;
- $args->last_login = "20110607120549";';
- $expected = 'UPDATE "xe_member" as "member" SET "member_srl" = 4, "last_login" = \'20110607120549\' WHERE "member_srl" = 4';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_module_updatePoint(){
- $xml_file = _XE_PATH_ . "modules/point/queries/updatePoint.xml";
- $argsString = ' $args->member_srl = 4;
- $args->point = 105;';
- $expected = 'UPDATE "xe_point" as "point" SET "point" = 105 WHERE "member_srl" = 4';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_module_updateCounterUnique(){
- $xml_file = _XE_PATH_ . "modules/counter/queries/updateCounterUnique.xml";
- $argsString = '$args->regdate = 20110607;
- ';
- $expected = 'UPDATE "xe_counter_status" as "counter_status" SET "unique_visitor" = "unique_visitor" + 1,
- "pageview" = "pageview" + 1 WHERE "regdate" = 20110607 ';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_module_updateMenu(){
- $xml_file = _XE_PATH_ . "modules/menu/queries/updateMenu.xml";
- $argsString = '$args->menu_srl = 204;
- $args->title = "test_menu";
- ';
- $expected = 'UPDATE "xe_menu" as "menu" SET "title" = \'test_menu\' WHERE "menu_srl" = 204';
- $this->_test($xml_file, $argsString, $expected);
- }
-
-
- function test_menu_updateMenuItemNode(){
- $xml_file = _XE_PATH_ . "modules/menu/queries/updateMenuItemNode.xml";
- $argsString = '$args->parent_srl = 0;
- $args->menu_srl = 237423;
- $args->listorder = -8;
- $args->menu_item_srl = 237431;';
- $expected = 'UPDATE "xe_menu_item" as "menu_item" SET "parent_srl" = 0, "listorder" = -8 WHERE "menu_item_srl" = 237431';
- $this->_test($xml_file, $argsString, $expected);
- }
-
-// $queryTester->test_admin_deleteActionForward();
-// $queryTester->test_module_insertModule();
-
-
- }
diff --git a/tests/classes/db/db/xml_query/cubrid/data/click_count.xml b/tests/classes/db/db/xml_query/cubrid/data/click_count.xml
deleted file mode 100644
index 3dd210b09..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/click_count.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/cubrid/data/doc_subquery.xml b/tests/classes/db/db/xml_query/cubrid/data/doc_subquery.xml
deleted file mode 100644
index 5709c7a17..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/doc_subquery.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/cubrid/data/from_correlated1.xml b/tests/classes/db/db/xml_query/cubrid/data/from_correlated1.xml
deleted file mode 100644
index 7c2c27143..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/from_correlated1.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/cubrid/data/from_correlated2.xml b/tests/classes/db/db/xml_query/cubrid/data/from_correlated2.xml
deleted file mode 100644
index 8dc162154..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/from_correlated2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/cubrid/data/from_uncorrelated1.xml b/tests/classes/db/db/xml_query/cubrid/data/from_uncorrelated1.xml
deleted file mode 100644
index ec83f3f36..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/from_uncorrelated1.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/cubrid/data/from_uncorrelated2.xml b/tests/classes/db/db/xml_query/cubrid/data/from_uncorrelated2.xml
deleted file mode 100644
index 6431b3b90..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/from_uncorrelated2.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/cubrid/data/ignore_index_hint.xml b/tests/classes/db/db/xml_query/cubrid/data/ignore_index_hint.xml
deleted file mode 100644
index e911abce5..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/ignore_index_hint.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/cubrid/data/index_hint_for_all.xml b/tests/classes/db/db/xml_query/cubrid/data/index_hint_for_all.xml
deleted file mode 100644
index b0784fa94..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/index_hint_for_all.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/cubrid/data/mysql_index_hint.xml b/tests/classes/db/db/xml_query/cubrid/data/mysql_index_hint.xml
deleted file mode 100644
index 702080eb5..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/mysql_index_hint.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/cubrid/data/one_index_hint_one_table.xml b/tests/classes/db/db/xml_query/cubrid/data/one_index_hint_one_table.xml
deleted file mode 100644
index 070ed3697..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/one_index_hint_one_table.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/cubrid/data/opage.getOpageList.xml b/tests/classes/db/db/xml_query/cubrid/data/opage.getOpageList.xml
deleted file mode 100644
index 2e7964335..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/opage.getOpageList.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/classes/db/db/xml_query/cubrid/data/resource.getLatestItem.xml b/tests/classes/db/db/xml_query/cubrid/data/resource.getLatestItem.xml
deleted file mode 100644
index f6fa06e83..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/resource.getLatestItem.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/classes/db/db/xml_query/cubrid/data/rlike1.xml b/tests/classes/db/db/xml_query/cubrid/data/rlike1.xml
deleted file mode 100644
index 895b1ccb0..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/rlike1.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/classes/db/db/xml_query/cubrid/data/select_correlated1.xml b/tests/classes/db/db/xml_query/cubrid/data/select_correlated1.xml
deleted file mode 100644
index 797d878e3..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/select_correlated1.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/cubrid/data/select_correlated2.xml b/tests/classes/db/db/xml_query/cubrid/data/select_correlated2.xml
deleted file mode 100644
index 85ab25308..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/select_correlated2.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/cubrid/data/select_uncorrelated1.xml b/tests/classes/db/db/xml_query/cubrid/data/select_uncorrelated1.xml
deleted file mode 100644
index 00e556e35..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/select_uncorrelated1.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/cubrid/data/select_uncorrelated2.xml b/tests/classes/db/db/xml_query/cubrid/data/select_uncorrelated2.xml
deleted file mode 100644
index a42294bcf..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/select_uncorrelated2.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/cubrid/data/syndication.getGrantedModules.xml b/tests/classes/db/db/xml_query/cubrid/data/syndication.getGrantedModules.xml
deleted file mode 100644
index 97d2b4ec9..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/syndication.getGrantedModules.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/classes/db/db/xml_query/cubrid/data/syndication.getModules.xml b/tests/classes/db/db/xml_query/cubrid/data/syndication.getModules.xml
deleted file mode 100644
index fbbe83ad9..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/syndication.getModules.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/classes/db/db/xml_query/cubrid/data/three_index_hints_two_tables.xml b/tests/classes/db/db/xml_query/cubrid/data/three_index_hints_two_tables.xml
deleted file mode 100644
index 6656d3b98..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/three_index_hints_two_tables.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/cubrid/data/three_index_hints_two_tables_combined.xml b/tests/classes/db/db/xml_query/cubrid/data/three_index_hints_two_tables_combined.xml
deleted file mode 100644
index f2ac06e76..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/three_index_hints_two_tables_combined.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/cubrid/data/two_index_hints_one_table.xml b/tests/classes/db/db/xml_query/cubrid/data/two_index_hints_one_table.xml
deleted file mode 100644
index 832becd1b..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/two_index_hints_one_table.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/cubrid/data/where_correlated1.xml b/tests/classes/db/db/xml_query/cubrid/data/where_correlated1.xml
deleted file mode 100644
index f6115c71f..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/where_correlated1.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/cubrid/data/where_correlated2.xml b/tests/classes/db/db/xml_query/cubrid/data/where_correlated2.xml
deleted file mode 100644
index 2ab45461c..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/where_correlated2.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/cubrid/data/where_uncorrelated1.xml b/tests/classes/db/db/xml_query/cubrid/data/where_uncorrelated1.xml
deleted file mode 100644
index 248b63ae9..000000000
--- a/tests/classes/db/db/xml_query/cubrid/data/where_uncorrelated1.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mssql/MssqlIndexHintTest.php b/tests/classes/db/db/xml_query/mssql/MssqlIndexHintTest.php
deleted file mode 100644
index 307381d20..000000000
--- a/tests/classes/db/db/xml_query/mssql/MssqlIndexHintTest.php
+++ /dev/null
@@ -1,65 +0,0 @@
- */
-
- class MssqlIndexHintTest extends MssqlTest {
- var $xmlPath = 'data/';
-
- function MssqlIndexHintTest(){
- $this->xmlPath = str_replace('MssqlIndexHintTest.php', '', str_replace('\\', '/', __FILE__)) . $this->xmlPath;
- }
-
- function _test($xml_file, $argsString, $expected){
- $this->_testQuery($xml_file, $argsString, $expected, 'getSelectSql');
- }
-
- function testOneUseIndexHintAndOneTable(){
- $xml_file = $this->xmlPath . "one_index_hint_one_table.xml";
- $argsString = '';
- $expected = 'select * from [xe_member] as [member] with(index([idx_member_list_order]))';
- $this->_test($xml_file, $argsString, $expected);
- }
-
-
- function testTwoUseIndexHintsAndOneTable(){
- $xml_file = $this->xmlPath . "two_index_hints_one_table.xml";
- $argsString = '';
- $expected = 'select * from [xe_member] as [member] with(index([idx_member_list_order]), index([idx_member_srl]))';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testThreeUseIndexHintsAndTwoTables(){
- $xml_file = $this->xmlPath . "three_index_hints_two_tables.xml";
- $argsString = '';
- $expected = 'select * from [xe_member] as [member] with(index([idx_member_list_order]), index([idx_member_srl]))
- , [xe_document] as [document] with(index([idx_document_srl]))';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- /**
- * Tests that index is added if "for" attribute is "ALL"
- *
- * example: ...
- */
- function testIndexHintForAll(){
- $xml_file = $this->xmlPath . "index_hint_for_all.xml";
- $argsString = '';
- $expected = 'select * from [xe_member] as [member] with(index([idx_member_list_order]))';
- $this->_test($xml_file, $argsString, $expected);
- }
-
-
- function testIgnoreIndexHintIsSkipped(){
- $xml_file = $this->xmlPath . "ignore_index_hint.xml";
- $argsString = '';
- $expected = 'select * from [xe_member] as [member]';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testMysqlIndexHintIsSkipped(){
- $xml_file = $this->xmlPath . "mysql_index_hint.xml";
- $argsString = '';
- $expected = 'select * from [xe_member] as [member]';
- $this->_test($xml_file, $argsString, $expected);
- }
- }
-?>
diff --git a/tests/classes/db/db/xml_query/mssql/MssqlSelectOnlineTest.php b/tests/classes/db/db/xml_query/mssql/MssqlSelectOnlineTest.php
deleted file mode 100644
index aef9cc250..000000000
--- a/tests/classes/db/db/xml_query/mssql/MssqlSelectOnlineTest.php
+++ /dev/null
@@ -1,12 +0,0 @@
- */
- class MssqlSelectOnlineTest extends MssqlOnlineTest {
-
- function test_syndication_getGrantedModule(){
- $args->module_srl = 67;
- $output = executeQuery("syndication.getGrantedModule", $args);
- $this->assertEquals(0, $output->error, $output->error + ' ' + $output->message);
- }
- }
-
-?>
diff --git a/tests/classes/db/db/xml_query/mssql/MssqlSelectTest.php b/tests/classes/db/db/xml_query/mssql/MssqlSelectTest.php
deleted file mode 100644
index 64b3d3524..000000000
--- a/tests/classes/db/db/xml_query/mssql/MssqlSelectTest.php
+++ /dev/null
@@ -1,171 +0,0 @@
- */
-
- class MssqlSelectTest extends MssqlTest {
-
- function _test($xml_file, $argsString, $expected, $expectedArgs = NULL){
- $this->_testPreparedQuery($xml_file, $argsString, $expected, 'getSelectSql', $expectedArgs);
- }
-
- function testSelectStar(){
- $xml_file = _XE_PATH_ . "modules/module/queries/getAdminId.xml";
- $argsString = '$args->module_srl = 10;';
- $expected = 'SELECT * FROM [xe_module_admins] as [module_admins] , [xe_member] as [member] WHERE [module_srl] = ? and [member].[member_srl] = [module_admins].[member_srl]';
- $this->_test($xml_file, $argsString, $expected, array(10));
- }
-
- function testRequiredParameter(){
- $xml_file = _XE_PATH_ . "modules/module/queries/getAdminId.xml";
- $argsString = '';
- $expected = 'Date incorecte! Query-ul nu a putut fi executat.';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testWithoutCategoriesTag(){
- $xml_file = _XE_PATH_ . "modules/module/queries/getModuleCategories.xml";
- $argsString = '';
- $expected = 'SELECT * FROM [xe_module_categories] as [module_categories] ORDER BY [title] asc';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_module_getDefaultModules(){
- $xml_file = _XE_PATH_ . "modules/module/queries/getDefaultModules.xml";
- $argsString = '$args->site_srl = 0;';
- $expected = 'SELECT [modules].[site_srl]
- , [modules].[module]
- , [modules].[mid]
- , [modules].[browser_title]
- , [module_categories].[title] as [category]
- , [modules].[module_srl]
- FROM [xe_modules] as [modules]
- left join [xe_module_categories] as [module_categories]
- on [module_categories].[module_category_srl] = [modules].[module_category_srl]
- WHERE [modules].[site_srl] = ?
- ORDER BY [modules].[module] asc, [module_categories].[title] asc, [modules].[mid] asc';
- $this->_test($xml_file, $argsString, $expected, array(0));
- }
-
- function test_module_getSiteInfo(){
- $xml_file = _XE_PATH_ . "modules/module/queries/getSiteInfo.xml";
- $argsString = '$args->site_srl = 0;';
- $expected = 'SELECT [modules].[site_srl] as [module_site_srl]
- , [modules].[module_srl] as [module_srl]
- , [modules].[module] as [module]
- , [modules].[module_category_srl] as [module_category_srl]
- , [modules].[layout_srl] as [layout_srl]
- , [modules].[mlayout_srl] as [mlayout_srl]
- , [modules].[use_mobile] as [use_mobile]
- , [modules].[menu_srl] as [menu_srl]
- , [modules].[mid] as [mid]
- , [modules].[skin] as [skin]
- , [modules].[mskin] as [mskin]
- , [modules].[browser_title] as [browser_title]
- , [modules].[description] as [description]
- , [modules].[is_default] as [is_default]
- , [modules].[content] as [content]
- , [modules].[mcontent] as [mcontent]
- , [modules].[open_rss] as [open_rss]
- , [modules].[header_text] as [header_text]
- , [modules].[footer_text] as [footer_text]
- , [modules].[regdate] as [regdate]
- , [sites].[site_srl] as [site_srl]
- , [sites].[domain] as [domain]
- , [sites].[index_module_srl] as [index_module_srl]
- , [sites].[default_language] as [default_language]
- FROM [xe_sites] as [sites]
- left join [xe_modules] as [modules] on [modules].[module_srl] = [sites].[index_module_srl]
- WHERE [sites].[site_srl] = ? ';
- $this->_test($xml_file, $argsString, $expected, array(0));
- }
-
- function test_addon_getAddonInfo(){
- $xml_file = _XE_PATH_ . "modules/addon/queries/getAddonInfo.xml";
- $argsString = '$args->addon = "captcha";';
- $expected = 'SELECT *
- FROM [xe_addons] as [addons]
- WHERE [addon] = ? ';
- $this->_test($xml_file, $argsString, $expected, array("'captcha'"));
- }
-
- function test_addon_getAddons(){
- $xml_file = _XE_PATH_ . "modules/addon/queries/getAddons.xml";
- $argsString = '';
- $expected = 'SELECT *
- FROM [xe_addons] as [addons]
- ORDER BY [addon] asc';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_admin_getCommentCount(){
- $xml_file = _XE_PATH_ . "modules/admin/queries/getCommentCount.xml";
- $argsString = '';
- $expected = 'SELECT count(*) as [count]
- FROM [xe_comments] as [comments]';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_admin_getCommentDeclaredStatus(){
- $xml_file = _XE_PATH_ . "modules/admin/queries/getCommentDeclaredStatus.xml";
- $argsString = '$args->date = "20110411";';
- $expected = 'SELECT TOP 2 substr([regdate],1,8) as [date], count(*) as [count]
- FROM [xe_comment_declared_log] as [comment_declared_log]
- WHERE [regdate] >= ?
- GROUP BY substr([regdate],1,8)
- ORDER BY substr([regdate],1,8) asc';
- $this->_test($xml_file, $argsString, $expected, array("'20110411'"));
- }
-
- function test_member_getAutoLogin(){
- $xml_file = _XE_PATH_ . "modules/member/queries/getAutoLogin.xml";
- $argsString = '$args->autologin_key = 10;';
- $expected = 'SELECT [member].[user_id] as [user_id]
- , [member].[password] as [password]
- , [member_autologin].[autologin_key] as [autologin_key]
- FROM [xe_member] as [member] , [xe_member_autologin] as [member_autologin]
- WHERE [member_autologin].[autologin_key] = ?
- and [member].[member_srl] = [member_autologin].[member_srl]';
- $this->_test($xml_file, $argsString, $expected, array("'10'"));
- }
-
- /**
- * Query fails because XML is wrong - title column does not exist
- * in xe_modules. Maybe the developer ment "browser_title"
- */
- function test_opage_getOpageList(){
- $xml_file = _TEST_PATH_ . "db/xml_query/mssql/data/opage.getOpageList.xml";
- $argsString = '$args->s_title = "yuhuu";
- $args->module = \'opage\';';
- $expected = 'SELECT TOP 20 *
- FROM [xe_modules] as [modules]
- WHERE [module] = \'opage\' and ([title] like ?)
- ORDER BY [module_srl] desc';
- $this->_test($xml_file, $argsString, $expected, array("'%yuhuu%'"));
- }
-
- function test_module_getExtraVars(){
- $xml_file = _XE_PATH_ . "modules/module/queries/getModuleExtraVars.xml";
- $argsString = '$args->module_srl = 25;';
- $expected = 'SELECT * FROM [xe_module_extra_vars] as [module_extra_vars] WHERE [module_srl] in (?)';
- $this->_test($xml_file, $argsString, $expected, array(array(25)));
- }
-
- function test_module_getModuleSites(){
- $xml_file = _XE_PATH_ . "modules/module/queries/getModuleSites.xml";
- $argsString = '$args->module_srls = "67, 65";';
- $expected = 'SELECT [modules].[module_srl] as [module_srl], [sites].[domain] as [domain] FROM [xe_modules] as [modules] , [xe_sites] as [sites] WHERE [modules].[module_srl] in (?,?) and [sites].[site_srl] = [modules].[site_srl]';
- $this->_test($xml_file, $argsString, $expected, array(array(67, 65)));
- }
-
- function test_syndication_getGrantedModule(){
- $xml_file = _TEST_PATH_ . "db/xml_query/mssql/data/syndication.getGrantedModule.xml";
- $argsString = '$args->module_srl = 67;';
- $expected = 'select count(*) as [count]
- from [xe_module_grants] as [module_grants]
- where [module_srl] = ?
- and [name] in (\'access\',\'view\',\'list\')
- and ([group_srl] >= 1
- or [group_srl] = -1
- or [group_srl] = -2)';
- $this->_test($xml_file, $argsString, $expected, array(67));
- }
- }
diff --git a/tests/classes/db/db/xml_query/mssql/MssqlUpdateOnlineTest.php b/tests/classes/db/db/xml_query/mssql/MssqlUpdateOnlineTest.php
deleted file mode 100644
index 704771aa3..000000000
--- a/tests/classes/db/db/xml_query/mssql/MssqlUpdateOnlineTest.php
+++ /dev/null
@@ -1,13 +0,0 @@
- */
- class MssqlUpdateOnlineTest extends MssqlOnlineTest {
-
- function test_counter_updateCounterUnique(){
- $args->regdate = 20110211;
-
- $output = executeQuery("counter.updateCounterUnique", $args);
- $this->assertEquals(0, $output->error, $output->error + ' ' + $output->message);
- }
- }
-
-?>
diff --git a/tests/classes/db/db/xml_query/mssql/MssqlUpdateTest.php b/tests/classes/db/db/xml_query/mssql/MssqlUpdateTest.php
deleted file mode 100644
index 8d45a548c..000000000
--- a/tests/classes/db/db/xml_query/mssql/MssqlUpdateTest.php
+++ /dev/null
@@ -1,23 +0,0 @@
- */
-
-class MssqlUpdateTest extends MssqlTest {
-
- function _test($xml_file, $argsString, $expected, $expectedArgs = NULL) {
- $this->_testPreparedQuery($xml_file, $argsString, $expected, 'getUpdateSql', $expectedArgs = NULL);
- }
-
- function test_counter_updateCounterUnique() {
- $xml_file = _XE_PATH_ . "modules/counter/queries/updateCounterUnique.xml";
- $argsString = '$args->regdate = 25;';
- $expected = 'UPDATE [counter_status]
- SET [unique_visitor] = [unique_visitor] + ?
- , [pageview] = [pageview] + ?
- FROM [xe_counter_status] as [counter_status]
- WHERE [regdate] = ?';
- $this->_test($xml_file, $argsString, $expected, array("25", 1, 1));
- }
-
-}
-
-?>
diff --git a/tests/classes/db/db/xml_query/mssql/data/ignore_index_hint.xml b/tests/classes/db/db/xml_query/mssql/data/ignore_index_hint.xml
deleted file mode 100644
index e17cfde49..000000000
--- a/tests/classes/db/db/xml_query/mssql/data/ignore_index_hint.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mssql/data/index_hint_for_all.xml b/tests/classes/db/db/xml_query/mssql/data/index_hint_for_all.xml
deleted file mode 100644
index b0784fa94..000000000
--- a/tests/classes/db/db/xml_query/mssql/data/index_hint_for_all.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mssql/data/mysql_index_hint.xml b/tests/classes/db/db/xml_query/mssql/data/mysql_index_hint.xml
deleted file mode 100644
index 702080eb5..000000000
--- a/tests/classes/db/db/xml_query/mssql/data/mysql_index_hint.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mssql/data/one_index_hint_one_table.xml b/tests/classes/db/db/xml_query/mssql/data/one_index_hint_one_table.xml
deleted file mode 100644
index 54b660823..000000000
--- a/tests/classes/db/db/xml_query/mssql/data/one_index_hint_one_table.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mssql/data/opage.getOpageList.xml b/tests/classes/db/db/xml_query/mssql/data/opage.getOpageList.xml
deleted file mode 100644
index 2e7964335..000000000
--- a/tests/classes/db/db/xml_query/mssql/data/opage.getOpageList.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/classes/db/db/xml_query/mssql/data/syndication.getGrantedModule.xml b/tests/classes/db/db/xml_query/mssql/data/syndication.getGrantedModule.xml
deleted file mode 100644
index 9a2f20e29..000000000
--- a/tests/classes/db/db/xml_query/mssql/data/syndication.getGrantedModule.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/classes/db/db/xml_query/mssql/data/three_index_hints_two_tables.xml b/tests/classes/db/db/xml_query/mssql/data/three_index_hints_two_tables.xml
deleted file mode 100644
index f3a05c237..000000000
--- a/tests/classes/db/db/xml_query/mssql/data/three_index_hints_two_tables.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mssql/data/two_index_hints_one_table.xml b/tests/classes/db/db/xml_query/mssql/data/two_index_hints_one_table.xml
deleted file mode 100644
index def6aadab..000000000
--- a/tests/classes/db/db/xml_query/mssql/data/two_index_hints_one_table.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mysql/MysqlIndexHintTest.php b/tests/classes/db/db/xml_query/mysql/MysqlIndexHintTest.php
deleted file mode 100644
index bec4ac6c7..000000000
--- a/tests/classes/db/db/xml_query/mysql/MysqlIndexHintTest.php
+++ /dev/null
@@ -1,59 +0,0 @@
- */
-
- class MysqlIndexHintTest extends MysqlTest {
- var $xmlPath = 'data/';
-
- function MysqlIndexHintTest(){
- $this->xmlPath = str_replace('MysqlIndexHintTest.php', '', str_replace('\\', '/', __FILE__)) . $this->xmlPath;
- }
-
- function _test($xml_file, $argsString, $expected){
- $this->_testQuery($xml_file, $argsString, $expected, 'getSelectSql');
- }
-
- function testOneUseIndexHintAndOneTable(){
- $xml_file = $this->xmlPath . "one_index_hint_one_table.xml";
- $argsString = '';
- $expected = 'select * from `xe_member` as `member` use index (`idx_member_list_order`)';
- $this->_test($xml_file, $argsString, $expected);
- }
-
-
- function testTwoUseIndexHintsAndOneTable(){
- $xml_file = $this->xmlPath . "two_index_hints_one_table.xml";
- $argsString = '';
- $expected = 'select * from `xe_member` as `member` use index (`idx_member_list_order`, `idx_member_srl`)';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testThreeUseIndexHintsAndTwoTables(){
- $xml_file = $this->xmlPath . "three_index_hints_two_tables.xml";
- $argsString = '';
- $expected = 'select * from `xe_member` as `member` use index (`idx_member_list_order`, `idx_member_srl`)
- , `xe_document` as `document` use index (`idx_document_srl`)';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testThreeIndexHintsAndTwoTables_ForceAndIgnore(){
- $xml_file = $this->xmlPath . "three_index_hints_two_tables_combined.xml";
- $argsString = '';
- $expected = 'select * from `xe_member` as `member` force index (`idx_member_list_order`, `idx_member_srl`)
- , `xe_document` as `document` ignore index (`idx_document_srl`)';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- /**
- * Tests that index is added if "for" attribute is "ALL"
- *
- * example: ...
- */
- function testIndexHintForAll(){
- $xml_file = $this->xmlPath . "index_hint_for_all.xml";
- $argsString = '';
- $expected = 'select * from `xe_member` as `member` use index (`idx_member_list_order`)';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- }
-?>
diff --git a/tests/classes/db/db/xml_query/mysql/MysqlInsertTest.php b/tests/classes/db/db/xml_query/mysql/MysqlInsertTest.php
deleted file mode 100644
index aeb6c7057..000000000
--- a/tests/classes/db/db/xml_query/mysql/MysqlInsertTest.php
+++ /dev/null
@@ -1,76 +0,0 @@
- */
-
-/**
- * @class MysqlInsertTest
- * @brief Constains all test method for insert statements, using Mysql SQL syntax
- * @developer Corina Udrescu (xe_dev@arnia.ro)
- */
-class MysqlInsertTest extends MysqlTest
-{
- /**
- * @brief _test - local helper method
- * @developer Corina Udrescu (xe_dev@arnia.ro)
- * @access private
- * @param $xml_file string - Path to XML file containing the query to be tested
- * @param $argsString string - String containing PHP code that initializez the arguments that the query receives
- * @param $expected string - Expected SQL query as string
- * @param $columnList array - Array containing the column names that will be retrieved, in case only a part of the ones in the query file are needed
- * @return void
- */
- function _test($xml_file, $argsString, $expected, $columnList = NULL)
- {
- $this->_testQuery($xml_file, $argsString, $expected, 'getInsertSql', $columnList);
- }
-
- function testInsertIntoNumericColumnConvertsValue()
- {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/member_insert_injection.xml";
- $argsString = '$args->member_srl = 7;
- $args->find_account_question = "1\'";
- ';
- $expected = 'insert into `xe_member` (`member_srl`, `find_account_question`) values (7, 1)';
- $this->_test($xml_file, $argsString, $expected);
- }
-
-
-}
-
-/* End of file MysqlInsertTest.php */
-/* Location: ./tests/classes/db/db/xml_query/mysql/MysqlInsertTest.php */
- /**
- * @brief testInsertSelectStatement - checks that when query action is 'insert-selct' an 'INSERT INTO .. SELECT ...' statement is properly generated
- * @developer Corina Udrescu (xe_dev@arnia.ro)
- * @access public
- * @return void
- */
- function testInsertSelectStatement()
- {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/insert_select.xml";
- $argsString = '$args->condition_value = 7;';
- $expected = 'insert into `xe_table1` (`column1`, `column2`, `column3`)
- select `column4`, `column5`, `column6`
- from `xe_table2` as `table2`
- where `column4` >= 7';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testInsertSelectStatement2()
- {
- $xml_file = _XE_PATH_ . "modules/wiki/queries/insertLinkedDocuments.xml";
- $argsString = '$args->document_srl = 7;
- $args->module_srl = 10;
- $args->alias_list = array("unu", "doi");
- ';
- $expected = 'insert into `xe_wiki_links`
- (`cur_doc_srl`, `link_doc_srl`)
- select 7, `document_srl`
- from `xe_document_aliases` as `document_aliases`
- where `module_srl` = 10
- and `alias_title` in (\'unu\',\'doi\')';
- $this->_test($xml_file, $argsString, $expected);
- }
-}
-
-/* End of file MysqlInsertTest.php */
-/* Location: ./tests/classes/db/db/xml_query/mysql/MysqlInsertTest.php */
diff --git a/tests/classes/db/db/xml_query/mysql/MysqlSelectTest.php b/tests/classes/db/db/xml_query/mysql/MysqlSelectTest.php
deleted file mode 100644
index 53d2a6583..000000000
--- a/tests/classes/db/db/xml_query/mysql/MysqlSelectTest.php
+++ /dev/null
@@ -1,417 +0,0 @@
- */
-
-class MysqlSelectTest extends MysqlTest {
-
- function _test($xml_file, $argsString, $expected, $columnList = NULL) {
- $this->_testQuery($xml_file, $argsString, $expected, 'getSelectSql', $columnList);
- }
-
- function testConditionWithVarAndColumnDefaultValue_WithoutArgument() {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/resource.getLatestItem.xml";
- $argsString = '$args->item_srl = "";';
- $expected = 'select `package`.`module_srl` as `module_srl`
- , `package`.`status` as `status`
- , `package`.`category_srl` as `category_srl`
- , `package`.`member_srl` as `member_srl`
- , `package`.`package_srl` as `package_srl`
- , `package`.`path` as `path`
- , `package`.`license` as `license`
- , `package`.`title` as `title`
- , `package`.`homepage` as `homepage`
- , `package`.`description` as `package_description`
- , `package`.`voter` as `package_voter`
- , `package`.`voted` as `package_voted`
- , `package`.`downloaded` as `package_downloaded`
- , `package`.`regdate` as `package_regdate`
- , `package`.`last_update` as `package_last_update`
- , `member`.`nick_name` as `nick_name`
- , `member`.`user_id` as `user_id`
- , `item`.`item_srl` as `item_srl`
- , `item`.`document_srl` as `document_srl`
- , `item`.`file_srl` as `item_file_srl`
- , `item`.`screenshot_url` as `item_screenshot_url`
- , `item`.`version` as `item_version`
- , `item`.`voter` as `item_voter`
- , `item`.`voted` as `item_voted`
- , `item`.`downloaded` as `item_downloaded`
- , `item`.`regdate` as `item_regdate`
- from `xe_resource_packages` as `package`
- , `xe_member` as `member`
- , `xe_resource_items` as `item`
- where `package`.`member_srl` = `member`.`member_srl`
- and `item`.`item_srl` = `package`.`latest_item_srl`';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testConditionWithVarAndColumnDefaultValue_WithArgument() {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/resource.getLatestItem.xml";
- $argsString = '$args->item_srl = "10";';
- $expected = 'select `package`.`module_srl` as `module_srl`
- , `package`.`status` as `status`
- , `package`.`category_srl` as `category_srl`
- , `package`.`member_srl` as `member_srl`
- , `package`.`package_srl` as `package_srl`
- , `package`.`path` as `path`
- , `package`.`license` as `license`
- , `package`.`title` as `title`
- , `package`.`homepage` as `homepage`
- , `package`.`description` as `package_description`
- , `package`.`voter` as `package_voter`
- , `package`.`voted` as `package_voted`
- , `package`.`downloaded` as `package_downloaded`
- , `package`.`regdate` as `package_regdate`
- , `package`.`last_update` as `package_last_update`
- , `member`.`nick_name` as `nick_name`
- , `member`.`user_id` as `user_id`
- , `item`.`item_srl` as `item_srl`
- , `item`.`document_srl` as `document_srl`
- , `item`.`file_srl` as `item_file_srl`
- , `item`.`screenshot_url` as `item_screenshot_url`
- , `item`.`version` as `item_version`
- , `item`.`voter` as `item_voter`
- , `item`.`voted` as `item_voted`
- , `item`.`downloaded` as `item_downloaded`
- , `item`.`regdate` as `item_regdate`
- from `xe_resource_packages` as `package`
- , `xe_member` as `member`
- , `xe_resource_items` as `item`
- where `package`.`member_srl` = `member`.`member_srl`
- and `item`.`item_srl` = 10';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testSubstring() {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/substring.xml";
- $argsString = '$args->var_start_mmdd = "1102"; ';
- $expected = 'select * from `xe_member` as `member` where substr(`extra_vars_t1`.`value`,5,4) >= 1102';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testResource_getLatestItemList() {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/resource.getLatestItemList.xml";
- $argsString = '';
- $expected = 'select `package`.`module_srl` as `module_srl`
- , `package`.`status` as `status`
- , `package`.`category_srl` as `category_srl`
- , `package`.`member_srl` as `member_srl`
- , `package`.`package_srl` as `package_srl`
- , `package`.`path` as `path`
- , `package`.`license` as `license`
- , `package`.`title` as `title`
- , `package`.`homepage` as `homepage`
- , `package`.`description` as `package_description`
- , `package`.`voter` as `package_voter`
- , `package`.`voted` as `package_voted`
- , `package`.`downloaded` as `package_downloaded`
- , `package`.`regdate` as `package_regdate`
- , `package`.`last_update` as `package_last_update`
- , `member`.`nick_name` as `nick_name`
- , `member`.`user_id` as `user_id`
- , `item`.`item_srl` as `item_srl`
- , `item`.`document_srl` as `item_document_srl`
- , `item`.`file_srl` as `item_file_srl`
- , `item`.`screenshot_url` as `item_screenshot_url`
- , `item`.`version` as `item_version`
- , `item`.`voter` as `item_voter`
- , `item`.`voted` as `item_voted`
- , `item`.`downloaded` as `item_downloaded`
- , `item`.`regdate` as `item_regdate`
- , `files`.`source_filename` as `source_filename`
- , `files`.`sid` as `sid`
- from `xe_resource_packages` as `package`
- , `xe_member` as `member`
- , `xe_resource_items` as `item`
- , `xe_files` as `files`
- where (`package`.`status` = \'accepted\'
- and `package`.`member_srl` = `member`.`member_srl`
- and `item`.`item_srl` = `package`.`latest_item_srl`
- and `package`.`update_order` <= 0
- and `files`.`file_srl` = `item`.`file_srl`)
- and `package`.`update_order` <= 2100000000
- order by `package`.`update_order` asc
- limit 0, 20';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_Syndication_getGrantedModules() {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/syndication.getGrantedModules.xml";
- $argsString = '';
- $expected = 'select `module_srl`
- from `xe_module_grants` as `module_grants`
- where `name` in (\'access\',\'view\',\'list\')
- and (`group_srl` >= 1 or `group_srl` = -1 or `group_srl` = -2) group by `module_srl`';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_Like_Clause() {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/opage.getOpageList.like.xml";
- $argsString = '$args->s_mid = "test";';
- $expected = 'select *
- from `xe_modules` as `modules`
- where `module` = \'opage\'
- and (`mid` like \'%test%\')
- order by `module_srl` desc
- limit 0, 20';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_NotLike_Clause() {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/opage.getOpageList.notlike.xml";
- $argsString = '$args->s_mid = "test";';
- $expected = 'select *
- from `xe_modules` as `modules`
- where `module` = \'opage\'
- and (`mid` not like \'%test%\')
- order by `module_srl` desc
- limit 0, 20';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_NotLikeTail_Clause() {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/opage.getOpageList.notliketail.xml";
- $argsString = '$args->s_mid = "test";';
- $expected = 'select *
- from `xe_modules` as `modules`
- where `module` = \'opage\'
- and (`mid` not like \'%test\')
- order by `module_srl` desc
- limit 0, 20';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_NotLikePrefix_Clause() {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/opage.getOpageList.notlikeprefix.xml";
- $argsString = '$args->s_mid = "test";';
- $expected = 'select *
- from `xe_modules` as `modules`
- where `module` = \'opage\'
- and (`mid` not like \'test%\')
- order by `module_srl` desc
- limit 0, 20';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_WidgetsNewestDocument_getNewestDocuments() {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/widgets.newest_document.getNewestDocuments.xml";
- $argsString = '$args->module_srl = "566036,3777868";';
- $expected = 'select `modules`.`site_srl` as `site_srl`
- , `modules`.`mid` as `mid`
- , `documents`.*
- from `xe_modules` as `modules`
- , `xe_documents` as `documents`
- where (
- `documents`.`module_srl` not in (0)
- and `documents`.`module_srl` in (566036,3777868)
- and `modules`.`module_srl` = `documents`.`module_srl`)
- and `documents`.`list_order` <= 2100000000
- order by `documents`.`list_order` asc
- limit 20';
-
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_homepage_getNewestComments() {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/homepage.getNewestComments.xml";
- $argsString = ';';
- $expected = 'select `sites`.`domain` as `domain`
- , `comments`.*
- from `xe_homepages` as `homepages`
- , `xe_sites` as `sites`
- , `xe_comments` as `comments`
- , `xe_modules` as `modules`
- left join `xe_module_grants` as `module_grants`
- on `module_grants`.`module_srl` = `modules`.`module_srl`
- and `module_grants`.`name` = \'access\'
- and `module_grants`.`group_srl` not in (0,-1)
- where (`homepages`.`site_srl` = `sites`.`site_srl`
- and `homepages`.`site_srl` = `modules`.`site_srl`
- and `comments`.`module_srl` = `modules`.`module_srl`
- and `module_grants`.`group_srl` is null)
- and `comments`.`list_order` <= 2100000000
- order by `comments`.`list_order` asc limit 0, 5';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_distinct_outer_join() {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/distinct_outer_join.xml";
- $argsString = '$args->site_srl = 0;';
- $expected = 'select distinct `modules`.`module_srl` as `module_site_srl`
- from `xe_sites` as `sites`
- left join `xe_modules` as `modules` on `modules`.`module_srl` = `sites`.`index_module_srl`
- where `sites`.`site_srl` = 0';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_getDocumentListWithinComment() {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/document.getDocumentListWithinComment.xml";
- $argsString = '$args->module_srl = 19778968;
- $args->s_comment = "dfsds";
- $args->statusList = "PUBLIC, SECRET";
- ';
- $expected = 'select `documents`.`document_srl`, `documents`.`list_order`
- from `xe_documents` as `documents`
- , `xe_comments` as `comments`
- where (`documents`.`module_srl` in (19778968)
- and `documents`.`document_srl` = `comments`.`document_srl`
- and `documents`.`status` in (\'public\',\'secret\')
- and `comments`.`content` like \'%dfsds%\')
- and `comments`.`list_order` <= 2100000000
- group by `documents`.`document_srl`
- order by `comments`.`list_order` asc
- limit 0, 20';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- /**
- * Issue 2064
- * Queries should support both notin and not_in as valid operations
- */
- function test_not_in() {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/document.getNewestDocuments.xml";
- $argsString = '$args->module_srl = "345709,345710,345711,345728,345707,345670,345667,49113,16551,345679,50394,350665,345680,381846,381852,381917,345708,349028,345666,17173,49117,345671,345714,345665,349893,345696,345713,351967,330919,345685,16754,349027,348787,345672,350239,345697,345674,291882,345678,345729,345675,345721,345676,381867,294605,381864,345673,355113,353624,345681,345683,345668,345677,12424,158716,47498,101835,273679,142558,13818,12311,8723,78670,18919,365075,13833,14293,15891,27823,14291,177818,81000,11788,18918,13859,14102,14136,255783,134367,385619,317170,330312";
- $args->sort_index = "documents.list_order";
- $args->order_type = "asc";
- $args->list_count = 10;
- ';
- $expected = 'select `modules`.`site_srl` as `site_srl`, `modules`.`mid` as `mid`, `documents`.* from `xe_modules` as `modules`, `xe_documents` as `documents` where (`documents`.`module_srl` not in (0) and `documents`.`module_srl` in (345709,345710,345711,345728,345707,345670,345667,49113,16551,345679,50394,350665,345680,381846,381852,381917,345708,349028,345666,17173,49117,345671,345714,345665,349893,345696,345713,351967,330919,345685,16754,349027,348787,345672,350239,345697,345674,291882,345678,345729,345675,345721,345676,381867,294605,381864,345673,355113,353624,345681,345683,345668,345677,12424,158716,47498,101835,273679,142558,13818,12311,8723,78670,18919,365075,13833,14293,15891,27823,14291,177818,81000,11788,18918,13859,14102,14136,255783,134367,385619,317170,330312) and `modules`.`module_srl` = `documents`.`module_srl`) and `documents`.`list_order` <= 2100000000 order by `documents`.`list_order` asc limit 10';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- /**
- * Issue 2064
- * Query condition should be ignored if operation is invalid
- */
- function test_invalid_condition_operation() {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/document.getNewestDocumentsInvalid.xml";
- $argsString = '$args->module_srl = "345709,345710,345711,345728,345707,345670,345667,49113,16551,345679,50394,350665,345680,381846,381852,381917,345708,349028,345666,17173,49117,345671,345714,345665,349893,345696,345713,351967,330919,345685,16754,349027,348787,345672,350239,345697,345674,291882,345678,345729,345675,345721,345676,381867,294605,381864,345673,355113,353624,345681,345683,345668,345677,12424,158716,47498,101835,273679,142558,13818,12311,8723,78670,18919,365075,13833,14293,15891,27823,14291,177818,81000,11788,18918,13859,14102,14136,255783,134367,385619,317170,330312";
- $args->sort_index = "documents.list_order";
- $args->order_type = "asc";
- $args->list_count = 10;
- ';
- $expected = 'select `modules`.`site_srl` as `site_srl`, `modules`.`mid` as `mid`, `documents`.* from `xe_modules` as `modules`, `xe_documents` as `documents` where (`documents`.`module_srl` in (345709,345710,345711,345728,345707,345670,345667,49113,16551,345679,50394,350665,345680,381846,381852,381917,345708,349028,345666,17173,49117,345671,345714,345665,349893,345696,345713,351967,330919,345685,16754,349027,348787,345672,350239,345697,345674,291882,345678,345729,345675,345721,345676,381867,294605,381864,345673,355113,353624,345681,345683,345668,345677,12424,158716,47498,101835,273679,142558,13818,12311,8723,78670,18919,365075,13833,14293,15891,27823,14291,177818,81000,11788,18918,13859,14102,14136,255783,134367,385619,317170,330312) and `modules`.`module_srl` = `documents`.`module_srl`) and `documents`.`list_order` <= 2100000000 order by `documents`.`list_order` asc limit 10';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- /**
- * Issue 2114
- * 'Null' operation is ignored
- */
- function test_null()
- {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/page.pageTypeNullCheck.xml";
- $argsString = ' ';
- $expected = 'select `m`.`module_srl`, `m`.`mid`, `ev`.`value`
- from `xe_modules` as `m`
- left join `xe_module_extra_vars` as `ev`
- on `ev`.`name` = \'page_type\'
- and `m`.`module_srl` = `ev`.`module_srl`
- where `m`.`module` = \'page\'
- and `ev`.`value` is null
- ';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- /**
- * Issue 2114
- * 'Notnull' operation is ignored
- */
- function test_notnull()
- {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/page.pageTypeNotNullCheck.xml";
- $argsString = ' ';
- $expected = 'select `m`.`module_srl`, `m`.`mid`, `ev`.`value`
- from `xe_modules` as `m`
- left join `xe_module_extra_vars` as `ev`
- on `ev`.`name` = \'page_type\'
- and `m`.`module_srl` = `ev`.`module_srl`
- where `m`.`module` = \'page\'
- and `ev`.`value` is not null
- ';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function testLikeWithDot()
- {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/likewithdot.xml";
- $argsString = '';
- $expected = 'select *
- from `xe_layouts` as `layouts`
- where `site_srl` = 0
- and `layout_type` = \'p\'
- and `layout` like \'%.%\'';
- $this->_test($xml_file, $argsString, $expected);
-
- }
-
-
- function testFromSubquery()
- {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/from_subquery.xml";
- $argsString = '
- ';
- $expected = 'SELECT `A`.`member_srl` as `member_srl`, COUNT(`A`.`cnt`) as `count`
- FROM (
- SELECT `member_srl` as `member_srl`, count(*) AS `cnt`
- FROM `xe_documents` as `documents`
- GROUP BY `member_srl`
- ) AS `A`';
- $this->_test($xml_file, $argsString, $expected);
- }
-
-
- /**
- * Like with image extension
- */
- function testLikeImageExtension()
- {
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/like_image_extension.xml";
- $argsString = '';
- $expected = "select `files`.`upload_target_srl` as `document_srl`
- from `xe_files` as `files`
- , `xe_documents` as `documents`
- where (
- `files`.`upload_target_srl` = `documents`.`document_srl`
- and (`files`.`source_filename` like '%.jpg'
- or `files`.`source_filename` like '%.gif'
- or `files`.`source_filename` like '%.png'))
- and `documents`.`list_order` <= 2100000000
- group by `files`.`upload_target_srl`
- order by `documents`.`list_order` asc
- 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);
- }
-}
diff --git a/tests/classes/db/db/xml_query/mysql/MysqlUpdateTest.php b/tests/classes/db/db/xml_query/mysql/MysqlUpdateTest.php
deleted file mode 100644
index 5ba5799a8..000000000
--- a/tests/classes/db/db/xml_query/mysql/MysqlUpdateTest.php
+++ /dev/null
@@ -1,76 +0,0 @@
- */
-
- class MysqlUpdateTest extends MysqlTest {
-
- function _test($xml_file, $argsString, $expected, $columnList = null){
- $this->_testQuery($xml_file, $argsString, $expected, 'getUpdateSql', $columnList);
- }
-
- function test_document_updateDocumentStatus(){
- $xml_file = _XE_PATH_ . "modules/document/queries/updateDocumentStatus.xml";
- $argsString = '$args->is_secret = \'Y\';
- $args->status = \'SECRET\';
- ';
- $expected = 'update `xe_documents` as `documents` set `status` = \'secret\' where `is_secret` = \'y\'';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- /**
- * Issue 388 - Query cache error related table alias
- * http://code.google.com/p/xe-core/issues/detail?id=388
- */
- function test_importer_updateDocumentSync(){
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/importer.updateDocumentSync.xml";
- $argsString = '';
- $expected = 'UPDATE `xe_documents` as `documents`, `xe_member` as `member`
- SET `documents`.`member_srl` = `member`.`member_srl`
- WHERE `documents`.`user_id` = `member`.`user_id`
- ';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_document_updateItemDownloadedCount(){
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/document.updateItemDownloadedCount.xml";
- $argsString = '$args->module_srl = 10; $args->package_srl = 11; $args->item_srl = 12;';
- $expected = 'update `xe_resource_items` as `resource_items`
- set `downloaded` = `downloaded` + 1
- where `module_srl` = 10
- and `package_srl` = 11
- and `item_srl` = 12
- ';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_menu_updateMenuItemListorder(){
- $xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/menu.updateMenuItemListorder.xml";
- $argsString = '$args->menu_srl = 10; $args->parent_srl = 11; $args->listorder = 12;';
- $expected = 'update `xe_menu_item` as `menu_item`
- set `listorder` = `listorder` - 1
- where `menu_srl` = 10
- and `parent_srl` = 11
- and `listorder` <= 12';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_communication_setMessageReaded(){
- $xml_file = _XE_PATH_ . "modules/communication/queries/setMessageReaded.xml";
- $argsString = '$args->message_srl = 339321; $args->related_srl = 339321;';
- $expected = 'update `xe_member_message` as `member_message`
- set `readed` = \'y\'
- , `readed_date` = \'' . date("YmdHis") . '\'
- where `message_srl` = 339321 or `related_srl` = 339321';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- function test_session_updateSession(){
- $xml_file = _XE_PATH_ . "modules/session/queries/updateSession.xml";
- $argsString = '$args->session_key = 339321; $args->val = "yuhuu";';
- $expected = 'update `xe_session` as `session`
- set `member_srl` = 0, `val` = \'yuhuu\'
- , `ipaddress` = \''. $_SERVER['REMOTE_ADDR'] .'\'
- , `last_update` = \'' . date("YmdHis") . '\'
- where `session_key` = \'339321\'';
- $this->_test($xml_file, $argsString, $expected);
- }
- }
diff --git a/tests/classes/db/db/xml_query/mysql/data/cast.xml b/tests/classes/db/db/xml_query/mysql/data/cast.xml
deleted file mode 100644
index 9049dbe1b..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/cast.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
diff --git a/tests/classes/db/db/xml_query/mysql/data/click_count.xml b/tests/classes/db/db/xml_query/mysql/data/click_count.xml
deleted file mode 100644
index 3dd210b09..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/click_count.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mysql/data/convert.xml b/tests/classes/db/db/xml_query/mysql/data/convert.xml
deleted file mode 100644
index 96d982717..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/convert.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
diff --git a/tests/classes/db/db/xml_query/mysql/data/distinct_outer_join.xml b/tests/classes/db/db/xml_query/mysql/data/distinct_outer_join.xml
deleted file mode 100644
index 0c04f8a1a..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/distinct_outer_join.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/classes/db/db/xml_query/mysql/data/document.getDocumentListWithinComment.xml b/tests/classes/db/db/xml_query/mysql/data/document.getDocumentListWithinComment.xml
deleted file mode 100644
index 28f4a2c62..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/document.getDocumentListWithinComment.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
diff --git a/tests/classes/db/db/xml_query/mysql/data/document.getNewestDocuments.xml b/tests/classes/db/db/xml_query/mysql/data/document.getNewestDocuments.xml
deleted file mode 100644
index e6e7ac7e4..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/document.getNewestDocuments.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mysql/data/document.getNewestDocumentsInvalid.xml b/tests/classes/db/db/xml_query/mysql/data/document.getNewestDocumentsInvalid.xml
deleted file mode 100644
index 5a3ad2aad..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/document.getNewestDocumentsInvalid.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mysql/data/document.updateItemDownloadedCount.xml b/tests/classes/db/db/xml_query/mysql/data/document.updateItemDownloadedCount.xml
deleted file mode 100644
index bebb488a1..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/document.updateItemDownloadedCount.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/classes/db/db/xml_query/mysql/data/from_subquery.xml b/tests/classes/db/db/xml_query/mysql/data/from_subquery.xml
deleted file mode 100644
index f1918bcb3..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/from_subquery.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mysql/data/homepage.getNewestComments.xml b/tests/classes/db/db/xml_query/mysql/data/homepage.getNewestComments.xml
deleted file mode 100644
index 9bf58ae90..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/homepage.getNewestComments.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
diff --git a/tests/classes/db/db/xml_query/mysql/data/importer.updateDocumentSync.xml b/tests/classes/db/db/xml_query/mysql/data/importer.updateDocumentSync.xml
deleted file mode 100644
index a3351ac5d..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/importer.updateDocumentSync.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mysql/data/index_hint_for_all.xml b/tests/classes/db/db/xml_query/mysql/data/index_hint_for_all.xml
deleted file mode 100644
index b0784fa94..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/index_hint_for_all.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mysql/data/insert_select.xml b/tests/classes/db/db/xml_query/mysql/data/insert_select.xml
deleted file mode 100644
index 4abfd3754..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/insert_select.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mysql/data/like_image_extension.xml b/tests/classes/db/db/xml_query/mysql/data/like_image_extension.xml
deleted file mode 100644
index 2be232bce..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/like_image_extension.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mysql/data/likewithdot.xml b/tests/classes/db/db/xml_query/mysql/data/likewithdot.xml
deleted file mode 100644
index 6a40c30a0..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/likewithdot.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/classes/db/db/xml_query/mysql/data/member_insert_injection.xml b/tests/classes/db/db/xml_query/mysql/data/member_insert_injection.xml
deleted file mode 100644
index ab10e4b99..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/member_insert_injection.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/tests/classes/db/db/xml_query/mysql/data/menu.updateMenuItemListorder.xml b/tests/classes/db/db/xml_query/mysql/data/menu.updateMenuItemListorder.xml
deleted file mode 100644
index ced0e2640..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/menu.updateMenuItemListorder.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
diff --git a/tests/classes/db/db/xml_query/mysql/data/one_index_hint_one_table.xml b/tests/classes/db/db/xml_query/mysql/data/one_index_hint_one_table.xml
deleted file mode 100644
index c74defef5..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/one_index_hint_one_table.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mysql/data/opage.getOpageList.like.xml b/tests/classes/db/db/xml_query/mysql/data/opage.getOpageList.like.xml
deleted file mode 100644
index 72c5cab1f..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/opage.getOpageList.like.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mysql/data/opage.getOpageList.notlike.xml b/tests/classes/db/db/xml_query/mysql/data/opage.getOpageList.notlike.xml
deleted file mode 100644
index 133884d23..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/opage.getOpageList.notlike.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mysql/data/opage.getOpageList.notlikeprefix.xml b/tests/classes/db/db/xml_query/mysql/data/opage.getOpageList.notlikeprefix.xml
deleted file mode 100644
index 19c45efb1..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/opage.getOpageList.notlikeprefix.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mysql/data/opage.getOpageList.notliketail.xml b/tests/classes/db/db/xml_query/mysql/data/opage.getOpageList.notliketail.xml
deleted file mode 100644
index c32023fee..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/opage.getOpageList.notliketail.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mysql/data/page.pageTypeNotNullCheck.xml b/tests/classes/db/db/xml_query/mysql/data/page.pageTypeNotNullCheck.xml
deleted file mode 100644
index bff829baa..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/page.pageTypeNotNullCheck.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/classes/db/db/xml_query/mysql/data/page.pageTypeNullCheck.xml b/tests/classes/db/db/xml_query/mysql/data/page.pageTypeNullCheck.xml
deleted file mode 100644
index 0fefc0f27..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/page.pageTypeNullCheck.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/classes/db/db/xml_query/mysql/data/resource.getLatestItem.xml b/tests/classes/db/db/xml_query/mysql/data/resource.getLatestItem.xml
deleted file mode 100644
index f6fa06e83..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/resource.getLatestItem.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/classes/db/db/xml_query/mysql/data/resource.getLatestItemList.xml b/tests/classes/db/db/xml_query/mysql/data/resource.getLatestItemList.xml
deleted file mode 100644
index 041e30694..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/resource.getLatestItemList.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/classes/db/db/xml_query/mysql/data/substring.xml b/tests/classes/db/db/xml_query/mysql/data/substring.xml
deleted file mode 100644
index fef155bec..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/substring.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mysql/data/sumInCondition.xml b/tests/classes/db/db/xml_query/mysql/data/sumInCondition.xml
deleted file mode 100644
index b5353f374..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/sumInCondition.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/classes/db/db/xml_query/mysql/data/syndication.getGrantedModules.xml b/tests/classes/db/db/xml_query/mysql/data/syndication.getGrantedModules.xml
deleted file mode 100644
index 97d2b4ec9..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/syndication.getGrantedModules.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/classes/db/db/xml_query/mysql/data/three_index_hints_two_tables.xml b/tests/classes/db/db/xml_query/mysql/data/three_index_hints_two_tables.xml
deleted file mode 100644
index 0c635583c..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/three_index_hints_two_tables.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mysql/data/three_index_hints_two_tables_combined.xml b/tests/classes/db/db/xml_query/mysql/data/three_index_hints_two_tables_combined.xml
deleted file mode 100644
index 3981bebee..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/three_index_hints_two_tables_combined.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mysql/data/two_index_hints_one_table.xml b/tests/classes/db/db/xml_query/mysql/data/two_index_hints_one_table.xml
deleted file mode 100644
index 9dec3a774..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/two_index_hints_one_table.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/mysql/data/widgets.newest_document.getNewestDocuments.xml b/tests/classes/db/db/xml_query/mysql/data/widgets.newest_document.getNewestDocuments.xml
deleted file mode 100644
index b83244911..000000000
--- a/tests/classes/db/db/xml_query/mysql/data/widgets.newest_document.getNewestDocuments.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/classes/db/db/xml_query/sqlite/SqliteDeleteTest.php b/tests/classes/db/db/xml_query/sqlite/SqliteDeleteTest.php
deleted file mode 100644
index 5bc3830fd..000000000
--- a/tests/classes/db/db/xml_query/sqlite/SqliteDeleteTest.php
+++ /dev/null
@@ -1,18 +0,0 @@
- */
-
- class SqliteDeleteTest extends SqliteTest {
-
- function _test($xml_file, $argsString, $expected, $columnList = null){
- $this->_testQuery($xml_file, $argsString, $expected, 'getDeleteSql', $columnList);
- }
-
- function testDeleteIsGeneratedWithoutAlias(){
- $xml_file = _TEST_PATH_ . "db/xml_query/sqlite/data/module.deleteModuleConfig.xml";
- $argsString = '$args->module = "comment"; $args->site_srl = 0; ';
- $expected = 'delete from "xe_module_config"
- where "module" = \'comment\' and "site_srl" = 0';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- }
diff --git a/tests/classes/db/db/xml_query/sqlite/SqliteUpdateTest.php b/tests/classes/db/db/xml_query/sqlite/SqliteUpdateTest.php
deleted file mode 100644
index 2ab9c149d..000000000
--- a/tests/classes/db/db/xml_query/sqlite/SqliteUpdateTest.php
+++ /dev/null
@@ -1,22 +0,0 @@
- */
-
- class SqliteUpdateTest extends SqliteTest {
-
- function _test($xml_file, $argsString, $expected, $columnList = null){
- $this->_testQuery($xml_file, $argsString, $expected, 'getUpdateSql', $columnList);
- }
-
- function testUpdateIsGeneratedWithoutAlias(){
- $xml_file = _TEST_PATH_ . "db/xml_query/sqlite/data/member.updateLastLogin.xml";
- $argsString = '$args->member_srl = 4;
- $args->last_login = \'20111014184010\';
- ';
- $expected = 'UPDATE "xe_member"
- SET "member_srl" = 4
- , "last_login" = \'20111014184010\'
- WHERE "member_srl" = 4';
- $this->_test($xml_file, $argsString, $expected);
- }
-
- }
diff --git a/tests/classes/db/db/xml_query/sqlite/data/member.updateLastLogin.xml b/tests/classes/db/db/xml_query/sqlite/data/member.updateLastLogin.xml
deleted file mode 100644
index 3a8fde69d..000000000
--- a/tests/classes/db/db/xml_query/sqlite/data/member.updateLastLogin.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/classes/db/db/xml_query/sqlite/data/module.deleteModuleConfig.xml b/tests/classes/db/db/xml_query/sqlite/data/module.deleteModuleConfig.xml
deleted file mode 100644
index bdc99660b..000000000
--- a/tests/classes/db/db/xml_query/sqlite/data/module.deleteModuleConfig.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/tests/classes/file/FileHandlerTest.php b/tests/classes/file/FileHandlerTest.php
deleted file mode 100644
index 793a76fe6..000000000
--- a/tests/classes/file/FileHandlerTest.php
+++ /dev/null
@@ -1,81 +0,0 @@
- */
-
-if(!defined('__XE__')) require dirname(__FILE__).'/../../Bootstrap.php';
-
-require_once _XE_PATH_.'classes/file/FileHandler.class.php';
-
-class FileHandlerTest extends PHPUnit_Framework_TestCase
-{
- public function testGetRealPath()
- {
- $this->assertEquals(FileHandler::getRealPath(__FILE__), __FILE__);
- $this->assertEquals(FileHandler::getRealPath('./tests/classes/file/FileHandlerTest.php'), __FILE__);
- }
-
- public function testFileMethods()
- {
- $mock = dirname(__FILE__).'/mock.txt';
- $mock2 = dirname(__FILE__).'/mock2.txt';
- touch($mock);
-
- // copy file
- $this->assertTrue(is_readable($mock));
- FileHandler::copyFile($mock, $mock2);
- $this->assertTrue(is_readable($mock2));
-
- // remove file
- $this->assertTrue(FileHandler::removeFile($mock2));
- $this->assertFalse(is_readable($mock2));
- $this->assertFalse(FileHandler::removeFile($mock2));
-
- // rename file
- $this->assertTrue(FileHandler::rename($mock, $mock2));
- $this->assertFalse(is_readable($mock));
- $this->assertTrue(is_readable($mock2));
- $this->assertFalse(FileHandler::rename($mock, $mock2));
-
- // move file
- $this->assertTrue(FileHandler::rename($mock2, $mock));
- $this->assertTrue(is_readable($mock));
- $this->assertFalse(is_readable($mock2));
- $this->assertTrue(touch($mock2) && is_readable($mock2));
- $this->assertTrue(FileHandler::moveFile($mock, $mock2));
- $this->assertFalse(is_readable($mock));
- $this->assertTrue(is_readable($mock2));
-
- // remove file
- $this->assertFalse(FileHandler::removeFile($mock));
- $this->assertTrue(FileHandler::removeFile($mock2));
- $this->assertFalse(is_readable($mock));
- $this->assertFalse(is_readable($mock2));
- }
-
- public function testFileSize()
- {
- // file size
- $this->assertEquals(FileHandler::filesize(0), '0Byte');
- $this->assertEquals(FileHandler::filesize(1), '1Byte');
- $this->assertEquals(FileHandler::filesize(386), '386Bytes');
- $this->assertEquals(FileHandler::filesize(1023), '1023Bytes');
- $this->assertEquals(FileHandler::filesize(1024), '1.0KB');
- $this->assertEquals(FileHandler::filesize(2480), '2.4KB');
- $this->assertEquals(FileHandler::filesize(1024*1024-1), '1024.0KB');
- $this->assertEquals(FileHandler::filesize(1024*1024), '1.00MB');
- $this->assertEquals(FileHandler::filesize(3*1024*1024+210*1024), '3.21MB');
-
- // return bytes
- $this->assertEquals(FileHandler::returnBytes('0B'), 0);
- $this->assertEquals(FileHandler::returnBytes('1024B'), 1024);
- $this->assertEquals(FileHandler::returnBytes('1K'), 1024);
- $this->assertEquals(FileHandler::returnBytes('102.48K'), 1024*102.48);
- $this->assertEquals(FileHandler::returnBytes('1M'), 1024*1024);
- $this->assertEquals(FileHandler::returnBytes('1.12M'), 1024*1024*1.12);
- $this->assertEquals(FileHandler::returnBytes('1023.99M'), 1024*1024*1023.99);
- $this->assertEquals(FileHandler::returnBytes('1G'), 1024*1024*1024);
- $this->assertEquals(FileHandler::returnBytes('12.02G'), 1024*1024*1024*12.02);
- }
-}
-
-/* End of file FileHandlerTest.php */
-/* Location: ./tests/classes/file/FileHandlerTest.php */
diff --git a/tests/classes/frontendfile/FrontEndFileHandlerTest.php b/tests/classes/frontendfile/FrontEndFileHandlerTest.php
deleted file mode 100644
index 439b11202..000000000
--- a/tests/classes/frontendfile/FrontEndFileHandlerTest.php
+++ /dev/null
@@ -1,223 +0,0 @@
- */
-
-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
-{
- public function testHandler()
- {
- Context::setUseCdn('Y');
- Context::setRequestUrl('http://test.com');
-
- $handler = new FrontEndFileHandler();
-
- // js(head)
- $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' => '');
- $expected[] = array('file' => '/xe/common/js/xml_handler.js', 'targetie' => '');
- $expected[] = array('file' => '/xe/common/js/xml_js_filter.js', 'targetie' => '');
- $this->assertEquals($handler->getJsFileList(), $expected);
-
- unset($handler);
- unset($expected);
- $handler = new FrontEndFileHandler();
-
- // js(body)
- $handler->loadFile(array('./common/js/jquery.js', 'body'));
- $handler->loadFile(array('./common/js/js_app.js', 'body'));
- $handler->loadFile(array('./common/js/common.js', 'body'));
- $handler->loadFile(array('./common/js/xml_handler.js', 'body'));
- $handler->loadFile(array('./common/js/xml_js_filter.js', 'body'));
-
- $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' => '');
- $expected[] = array('file' => '/xe/common/js/xml_handler.js', 'targetie' => '');
- $expected[] = array('file' => '/xe/common/js/xml_js_filter.js', 'targetie' => '');
- $this->assertEquals($handler->getJsFileList('body'), $expected);
-
- unset($handler);
- unset($expected);
- $handler = new FrontEndFileHandler();
-
- // css
- $handler->loadFile(array('./common/css/xe.css'));
- $handler->loadFile(array('./common/css/common.css'));
-
- $expected[] = array('file' => '/xe/common/css/xe.css', 'media' => 'all', 'targetie' => '');
- $expected[] = array('file' => '/xe/common/css/common.css', 'media' => 'all', 'targetie' => '');
- $this->assertEquals($handler->getCssFileList(), $expected);
-
- unset($handler);
- unset($expected);
- $handler = new FrontEndFileHandler();
-
- // order (duplicate)
- $handler->loadFile(array('./common/js/jquery.js', 'head', '', -100000));
- $handler->loadFile(array('./common/js/js_app.js', 'head', '', -100000));
- $handler->loadFile(array('./common/js/common.js', 'head', '', -100000));
- $handler->loadFile(array('./common/js/xml_handler.js', 'head', '', -100000));
- $handler->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -100000));
- $handler->loadFile(array('./common/js/jquery.js', 'head', '', -100000));
- $handler->loadFile(array('./common/js/js_app.js', 'head', '', -100000));
- $handler->loadFile(array('./common/js/common.js', 'head', '', -100000));
- $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', 'targetie' => '');
- $expected[] = array('file' => '/xe/common/js/js_app.js', 'targetie' => '');
- $expected[] = array('file' => '/xe/common/js/common.js', 'targetie' => '');
- $expected[] = array('file' => '/xe/common/js/xml_handler.js', 'targetie' => '');
- $expected[] = array('file' => '/xe/common/js/xml_js_filter.js', 'targetie' => '');
- $this->assertEquals($handler->getJsFileList(), $expected);
-
- // order (redefine)
- unset($handler);
- unset($expected);
- $handler = new FrontEndFileHandler();
- $handler->loadFile(array('./common/js/jquery.js', 'head', '', -100000));
- $handler->loadFile(array('./common/js/js_app.js', 'head', '', -100000));
- $handler->loadFile(array('./common/js/common.js', 'head', '', -100000));
- $handler->loadFile(array('./common/js/xml_handler.js', 'head', '', -100000));
- $handler->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -100000));
- $handler->loadFile(array('./common/js/jquery.js', 'head', '', 1));
-
- $expected[] = array('file' => '/xe/common/js/js_app.js', 'targetie' => '');
- $expected[] = array('file' => '/xe/common/js/common.js', 'targetie' => '');
- $expected[] = array('file' => '/xe/common/js/xml_handler.js', 'targetie' => '');
- $expected[] = array('file' => '/xe/common/js/xml_js_filter.js', 'targetie' => '');
- $expected[] = array('file' => '/xe/common/js/jquery.js', 'targetie' => '');
- $this->assertEquals($handler->getJsFileList(), $expected);
-
- // unload
- unset($handler);
- unset($expected);
- $handler = new FrontEndFileHandler();
-
- $handler->loadFile(array('./common/js/jquery.js', 'head', '', -100000));
- $handler->loadFile(array('./common/js/js_app.js', 'head', '', -100000));
- $handler->loadFile(array('./common/js/common.js', 'head', '', -100000));
- $handler->loadFile(array('./common/js/xml_handler.js', 'head', '', -100000));
- $handler->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -100000));
- $handler->unloadFile('./common/js/jquery.js', '', 'all');
-
- $expected[] = array('file' => '/xe/common/js/js_app.js', 'targetie' => '');
- $expected[] = array('file' => '/xe/common/js/common.js', 'targetie' => '');
- $expected[] = array('file' => '/xe/common/js/xml_handler.js', 'targetie' => '');
- $expected[] = array('file' => '/xe/common/js/xml_js_filter.js', 'targetie' => '');
- $this->assertEquals($handler->getJsFileList(), $expected);
-
- // target IE(js)
- unset($handler);
- unset($expected);
- $handler = new FrontEndFileHandler();
-
- $handler->loadFile(array('./common/js/jquery.js', 'head', 'ie6'));
- $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', 'targetie' => 'ie6');
- $expected[] = array('file' => '/xe/common/js/jquery.js', 'targetie' => 'ie7');
- $expected[] = array('file' => '/xe/common/js/jquery.js', 'targetie' => 'ie8');
- $this->assertEquals($handler->getJsFileList(), $expected);
-
- // target IE(css)
- unset($handler);
- unset($expected);
- $handler = new FrontEndFileHandler();
-
- $handler->loadFile(array('./common/css/common.css', null, 'ie6'));
- $handler->loadFile(array('./common/css/common.css', null, 'ie7'));
- $handler->loadFile(array('./common/css/common.css', null, 'ie8'));
-
- $expected[] = array('file' => '/xe/common/css/common.css', 'media'=>'all', 'targetie' => 'ie6');
- $expected[] = array('file' => '/xe/common/css/common.css','media'=>'all', 'targetie' => 'ie7');
- $expected[] = array('file' => '/xe/common/css/common.css', 'media'=>'all', 'targetie' => 'ie8');
- $this->assertEquals($handler->getCssFileList(), $expected);
-
- // media
- unset($handler);
- unset($expected);
- $handler = new FrontEndFileHandler();
-
- $handler->loadFile(array('./common/css/common.css', 'all'));
- $handler->loadFile(array('./common/css/common.css', 'screen'));
- $handler->loadFile(array('./common/css/common.css', 'handled'));
-
- $expected[] = array('file' => '/xe/common/css/common.css', 'media'=>'all', 'targetie' => '');
- $expected[] = array('file' => '/xe/common/css/common.css','media'=>'screen', 'targetie' => '');
- $expected[] = array('file' => '/xe/common/css/common.css', 'media'=>'handled', 'targetie' => '');
- $this->assertEquals($handler->getCssFileList(), $expected);
-
- // CDN
- unset($handler);
- unset($expected);
- $handler = new FrontEndFileHandler();
-
- $handler->loadFile(array('./common/css/common.css'), true, 'http://static.xpressengine.com/core/', 'v');
-
- $expected[] = array('file' => 'http://static.xpressengine.com/core/v/common/css/common.css', 'media'=>'all', 'targetie' => '');
- $this->assertEquals($handler->getCssFileList(), $expected);
-
- // CDN(no cdn setting)
- unset($handler);
- unset($expected);
- Context::setUseCdn('N');
- $handler = new FrontEndFileHandler();
-
- $handler->loadFile(array('./common/css/common.css'), true, 'http://static.xpressengine.com/core/', 'v');
-
- $expected[] = array('file' => '/xe/common/css/common.css', 'media'=>'all', 'targetie' => '');
- $this->assertEquals($handler->getCssFileList(), $expected);
-
- // CDN(use ssl)
- unset($handler);
- unset($expected);
- Context::setUseCdn('Y');
- Context::setRequestUrl('https://test.com');
- $handler = new FrontEndFileHandler();
-
- $handler->loadFile(array('./common/css/common.css'), true, 'http://static.xpressengine.com/core/', 'v');
-
- $expected[] = array('file' => '/xe/common/css/common.css', 'media'=>'all', 'targetie' => '');
- $this->assertEquals($handler->getCssFileList(), $expected);
-
- // external file
- unset($handler);
- unset($expected);
- Context::setUseCdn('Y');
- Context::setRequestUrl('http://test.com');
- $handler = new FrontEndFileHandler();
-
- $handler->loadFile(array('http://external.com/css/style2.css'));
- $handler->loadFile(array('http://external.com/css/style.css'), true, 'http://static.xpressengine.com/core/', 'v');
-
- $expected[] = array('file' => 'http://external.com/css/style2.css', 'media'=>'all', 'targetie' => '');
- $expected[] = array('file' => 'http://external.com/css/style.css', 'media'=>'all', 'targetie' => '');
- $this->assertEquals($handler->getCssFileList(), $expected);
-
- }
-}
-
-if(!class_exists('Context'))
-{
- require _XE_PATH_.'/tests/classes/context/Context.mock.php';
-}
-
-if(!function_exists('debugPrint'))
-{
- function debugPrint(){}
-}
diff --git a/tests/classes/security/SecurityTest.php b/tests/classes/security/SecurityTest.php
deleted file mode 100644
index 793bfb903..000000000
--- a/tests/classes/security/SecurityTest.php
+++ /dev/null
@@ -1,135 +0,0 @@
- */
-
-if(!defined('__XE__')) require dirname(__FILE__).'/../../Bootstrap.php';
-
-require_once _XE_PATH_.'/classes/security/Security.class.php';
-
-error_reporting(E_ALL & ~E_NOTICE);
-
-class SecurityTest extends PHPUnit_Framework_TestCase
-{
- protected function setUp()
- {
- /**
- * Setup mock data
- **/
-
- // string
- Context::set('content1', 'Hello, world');
- Context::set('content2', 'Wow, >_< !');
-
- // object
- $args = new stdClass;
- $args->prop1 = 'Normal string';
- $args->prop2 = 'He said, "Very nice!"';
- $args->prop3 = 'Strong Baby';
- Context::set('object1', $args);
-
- // array
- $arr = array();
- $arr[] = 'First';
- $arr[] = 'Second';
- $arr[] = 'Third';
- Context::set('array1', $arr);
-
- // associative array
- $aarr = array();
- $aarr['elem1'] = 'One 1';
- $aarr['elem2'] = 'Two 2';
- $aarr['elem3'] = 'Three 3';
- Context::set('array2', $aarr);
- }
-
- public function testEncodeHTML_DefaultContext()
- {
- $security = new Security();
-
- // normal string - one
- $this->setUp();
- $this->assertEquals('Hello, world', Context::get('content1'));
- $security->encodeHTML('content1');
- $this->assertEquals('<strong>Hello, world</strong>', Context::get('content1'));
-
- // normal string - two
- $this->setUp();
- $this->assertEquals('Hello, world', Context::get('content1'));
- $this->assertEquals('Wow, >_< !', Context::get('content2'));
- $security->encodeHTML('content1','content2');
- $this->assertEquals('<strong>Hello, world</strong>', Context::get('content1'));
- $this->assertEquals('Wow, >_< !', Context::get('content2'));
-
- // array
- $this->assertEquals(Context::get('array1'), array('First','Second','Third'));
- $security->encodeHTML('array1'); // should ignore this
- $this->assertEquals(Context::get('array1'), array('First','Second','Third'));
- $security->encodeHTML('array1.0'); // affect only first element
- $this->assertEquals(Context::get('array1'), array('<span class="first">F</span>irst','Second','Third'));
- $security->encodeHTML('array1.2'); // affects only third element
- $this->assertEquals(Context::get('array1'), array('<span class="first">F</span>irst','Second','<b>T</b>hird'));
- $this->setUp(); // reset;
- $this->assertEquals(Context::get('array1'), array('First','Second','Third'));
- $security->encodeHTML('array1.'); // affects all items
- $this->assertEquals(Context::get('array1'), array('<span class="first">F</span>irst','<u>S</u>econd','<b>T</b>hird'));
-
- // associated array
- $this->assertEquals(Context::get('array2'), array('elem1'=>'One 1','elem2'=>'Two 2','elem3'=>'Three 3'));
- $security->encodeHTML('array2'); // should ignore this
- $this->assertEquals(Context::get('array2'), array('elem1'=>'One 1','elem2'=>'Two 2','elem3'=>'Three 3'));
- $security->encodeHTML('array2.0'); // should ignore this
- $this->assertEquals(Context::get('array2'), array('elem1'=>'One 1','elem2'=>'Two 2','elem3'=>'Three 3'));
- $security->encodeHTML('array2.elem2'); // affects only 'elem2'
- $this->assertEquals(Context::get('array2'), array('elem1'=>'One 1','elem2'=>'Two <del>2</del>','elem3'=>'Three 3'));
- $this->setUp(); // reset;
- $this->assertEquals(Context::get('array2'), array('elem1'=>'One 1','elem2'=>'Two 2','elem3'=>'Three 3'));
- $security->encodeHTML('array2.'); // affects all items
- $this->assertEquals(Context::get('array2'), array('elem1'=>'One <ins>1</ins>','elem2'=>'Two <del>2</del>','elem3'=>'Three <addr>3</addr>'));
-
- // object
- $obj = new stdClass;
- $obj->prop1 = 'Normal string';
- $obj->prop2 = 'He said, "Very nice!"';
- $obj->prop3 = 'Strong Baby';
- $this->assertEquals(Context::get('object1'), $obj);
- $security->encodeHTML('object1'); // should ignore this
- $this->assertEquals(Context::get('object1'), $obj);
- $security->encodeHTML('object1.0'); // should ignore this
- $this->assertEquals(Context::get('object1'), $obj);
- $security->encodeHTML('object1.prop1'); // affects only 'prop1' property - no changes
- $this->assertEquals(Context::get('object1'), $obj);
- $security->encodeHTML('object1.prop3'); // affects only 'prop3' property
- $obj->prop3 = '<strong>Strong</strong> Baby';
- $this->assertEquals(Context::get('object1'), $obj);
- $this->setUp(); // reset
- $obj->prop3 = 'Strong Baby';
- $this->assertEquals(Context::get('object1'), $obj);
- $security->encodeHTML('object1.'); // affects all properties
- $obj->prop2 = 'He said, "Very nice!"';
- $obj->prop3 = '<strong>Strong</strong> Baby';
- $this->assertEquals(Context::get('object1'), $obj);
- }
-
- public function testEncodeHTML_CustomContext()
- {
- $array = array('Hello', 'World', 'Bold is not bald');
-
- // array with no nested objects or arrays
- $security = new Security($array);
- $returned = $security->encodeHTML('.');
- $this->assertEquals($returned, array('Hello', 'World', '<b>Bold</b> is not bald'));
-
- // associative array
- $array = array('first'=>'Hello', 'second'=>'World', '3rd'=>'Bold is not bald');
- $security = new Security($array);
- $returned = $security->encodeHTML('first','3rd');
- $this->assertEquals($returned, array('first'=>'Hello', 'second'=>'World', '3rd'=>'<b>Bold</b> is not bald'));
- }
-}
-
-if(!class_exists('Context'))
-{
- require _XE_PATH_.'/tests/classes/context/Context.mock.php';
-}
-
-/* End of file SecurityTest.php */
-/* Location: ./tests/classes/security/SecurityTest.php */
diff --git a/tests/classes/template/TemplateHandlerTest.php b/tests/classes/template/TemplateHandlerTest.php
deleted file mode 100644
index a377f0eee..000000000
--- a/tests/classes/template/TemplateHandlerTest.php
+++ /dev/null
@@ -1,268 +0,0 @@
- */
-
-if(!defined('__XE__')) require dirname(__FILE__).'/../../Bootstrap.php';
-
-require_once _XE_PATH_.'classes/file/FileHandler.class.php';
-require_once _XE_PATH_.'classes/template/TemplateHandler.class.php';
-
-class TemplateHandlerTest extends PHPUnit_Framework_TestCase
-{
- var $prefix = '';
-
- static public function provider()
- {
- return array(
- // pipe cond
- array(
- ' 10">Link',
- 'cond > 10){ ?> class="active">Link'
- ),
- // cond
- array(
- 'Link1say, hello',
- 'Link1cond){ ?>say, hello'
- ),
- // cond
- array(
- 'Link1Link2',
- 'Link1v==$__Context->k){ ?>Link2'
- ),
- // for loop
- array(
- '',
- 'i=0;$__Context->i<$__Context->len;$__Context->i++){ ?>- Link
'
- ),
- // foreach loop
- array(
- '',
- 'arr&&count($__Context->arr))foreach($__Context->arr as $__Context->key=>$__Context->val){ ?>- Link
arr2&&count($__Context->arr2))foreach($__Context->arr2 as $__Context->key2=>$__Context->val2){ ?>
'
- ),
- // while loop
- array(
- '',
- 'item=get_loop_item()){ ?>- Link
'
- ),
- // ~
- array(
- 'LinkHello, world ',
- 'Linkcond){ ?>Hello, world '
- ),
- // ~
- array(
- 'LinkHello, {$world}',
- 'Linkcond){ ?>Hello, world ?>'
- ),
- // ~ ~
- array(
- 'LinkHello, worldWow',
- 'Linkcond){ ?>Hello, worldWow'
- ),
- // ~ ~ ~
- array(
- 'LinkHello, worldHaHaWow',
- 'Linkcond){ ?>Hello, worldcond2){ ?>HaHaWow'
- ),
- // ~
- array(
- 'Repeat this',
- 'i=0;$__Context->i<$__Context->len;$__Context->i++){ ?>Repeat this'
- ),
- // ~
- array(
- 'item{$key} : {$val}',
- 'arr&&count($__Context->arr))foreach($__Context->arr as $__Context->key=>$__Context->val){ ?>itemkey ?> : val ?>'
- ),
- // ~
- array(
- '{$v->text}',
- 'item=$__Context->list->getItem()){ ?>v->text ?>'
- ),
- // ~ ~ ~ ~
- array(
- ' A BC',
- 'var){ ?> ABC'
- ),
- // invalid block statement
- array(
- '',
- ''
- ),
- // {@ ...PHP_CODE...}
- array(
- '{@$list_page = $page_no}',
- 'list_page = $__Context->page_no ?>'
- ),
- // %load_js_plugin
- array(
- '',
- ''
- ),
- // #include
- array(
- 'This is another dummy
',
- 'compile(\'tests/classes/template\',\'sample.html\') ?>This is another dummy
'
- ),
- //
- array(
- 'This is another dummy
',
- 'compile(\'tests/classes\',\'sample.html\') ?>This is another dummy
'
- ),
- //
- array(
- '',
- ''
- ),
- //
- array(
- '',
- ''
- ),
- //
- array(
- '',
- ''
- ),
- //
- array(
- '',
- 'compile(); ?>'
- ),
- //
- array(
- '',
- ''
- ),
- //
- array(
- '',
- ''
- ),
- // comment
- array(
- '',
- ''
- ),
- // self-closing tag
- array(
- '',
- 'foo){ ?>'
- ),
- // relative path1
- array(
- '
',
- '
'
- ),
- // relative path2
- array(
- '
',
- '
'
- ),
- // error case
- array(
- '
',
- 'layout_info->logo_image){ ?>
'
- ),
- // error case - ignore stylesheets
- array(
- '',
- ''
- ),
- // error case - ignore json
- array(
- '',
- ''
- ),
- // error case - inline javascript
- array(
- '',
- ''
- ),
- // issue 103
- array(
- '',
- ''
- ),
- // issue 135
- array(
- '{$key}
Loop block {$val}
',
- '_m_list_all&&count($__Context->_m_list_all))foreach($__Context->_m_list_all as $__Context->key=>$__Context->val){ ?>key ?>
Loop block val ?>
'
- ),
- // issue 136
- array(
- '
bar',
- 'var==\'foo\'){ ?>
bar'
- ),
- // issue 188
- array(
- 'Hello, world!
',
- 'ii < $__Context->nn){ ?>dummy&&count($__Context->dummy))foreach($__Context->dummy as $__Context->k=>$__Context->v){ ?>Hello, world!
'
- ),
- // issue 190
- array(
- 'Hello, world!
',
- 'i >= $__Context->n)){ ?>dummy&&count($__Context->dummy))foreach($__Context->dummy as $__Context->k=>$__Context->v){ ?>Hello, world!
'
- ),
- // issue 183
- array(
- '',
- 'vvvls&&count($__Context->vvvls))foreach($__Context->vvvls as $__Context->vvv){ ?>| vvv ?> |
'."\n".'| C | D |
'
- ),
- // issue 512 - ignores