Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mystralkk committed Jun 10, 2022
1 parent a789995 commit 8fea284
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
6 changes: 4 additions & 2 deletions tests/files/dummy/system/lib-plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
*
*/

require_once 'tst.class.php';
require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/tst.class.php';
Tst::init();

require_once Tst::$tests . 'files/classes/xmldb.class.php';

if (strpos(strtolower($_SERVER['PHP_SELF']), 'lib-plugins.php') !== false) {
Expand Down Expand Up @@ -2023,7 +2025,7 @@ function PLG_getWhatsNew()
* @note As for valid value for $commentType, see system/classes/Akismet.php
* @link http://wiki.geeklog.net/index.php/Filtering_Spam_with_Spam-X
*/
function PLG_checkforSpam($comment, $action = -1, $permanentLink,
function PLG_checkforSpam($comment, $action = -1, $permanentLink = null,
$commentType = Geeklog\Akismet::COMMENT_TYPE_COMMENT,
$commentAuthor = null, $commentAuthorEmail = null, $commentAuthorURL = null)
{
Expand Down
16 changes: 15 additions & 1 deletion tests/system/classes/LangConfValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class LangConfValidationTest extends TestCase

protected function setUp(): void
{
global $_CONF, $_CONF_VALIDATE, $_USER, $_DB_dbms;
global $_CONF, $_CONF_VALIDATE, $_TABLES, $_USER, $_DB_dbms;

// set dummy values for the $_CONF options used in the language files
$_CONF = array();
Expand Down Expand Up @@ -84,6 +84,18 @@ protected function setUp(): void
define('RECAPTCHA_SUPPORT_V3', 4);
}

if (!defined('LIKES_BLOCK_DISPLAY_LIKE')) {
define('LIKES_BLOCK_DISPLAY_LIKE', 1);
}

if (!defined('LIKES_BLOCK_DISPLAY_DISLIKE')) {
define('LIKES_BLOCK_DISPLAY_DISLIKE', 2);
}

if (!defined('LIKES_BLOCK_DISPLAY_ALL')) {
define('LIKES_BLOCK_DISPLAY_ALL', 3);
}

// there's a date() call somewhere - make PHP 5.2 shut up
$system_timezone = @date_default_timezone_get();
date_default_timezone_set($system_timezone);
Expand All @@ -92,6 +104,8 @@ protected function setUp(): void

include Tst::$root . 'language/english.php';
include Tst::$public . 'admin/configuration_validation.php';
require_once Tst::$root . 'tests/files/dummy/system/lib-plugins.php';
$_TABLES['groups'] = 'gl_groups';
require_once Tst::$public . 'admin/install/config-install.php';

install_config($this->c);
Expand Down

0 comments on commit 8fea284

Please sign in to comment.