mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 08:41:39 +09:00
Fix various warnings in PHP 8.0
This commit is contained in:
parent
f46b41f437
commit
60465fb2db
23 changed files with 65 additions and 55 deletions
|
|
@ -236,7 +236,7 @@ class Context
|
|||
self::setRequestMethod();
|
||||
if (in_array(self::$_instance->request_method, array('GET', 'POST', 'JSON')))
|
||||
{
|
||||
$method = $_SERVER['REQUEST_METHOD'] ?: 'GET';
|
||||
$method = $_SERVER['REQUEST_METHOD'] ?? 'GET';
|
||||
$route_info = Rhymix\Framework\Router::parseURL($method, RX_REQUEST_URL, Rhymix\Framework\Router::getRewriteLevel());
|
||||
self::setRequestArguments($route_info->args);
|
||||
self::$_route_info = $route_info;
|
||||
|
|
@ -387,7 +387,7 @@ class Context
|
|||
|
||||
// set locations for javascript use
|
||||
$current_url = $request_uri = self::getRequestUri();
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'GET' && self::$_get_vars)
|
||||
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'GET' && self::$_get_vars)
|
||||
{
|
||||
if ($query_string = http_build_query(self::$_get_vars))
|
||||
{
|
||||
|
|
@ -803,7 +803,7 @@ class Context
|
|||
$plugin_name = null;
|
||||
}
|
||||
|
||||
if (!$GLOBALS['lang'] instanceof Rhymix\Framework\Lang)
|
||||
if (!(($GLOBALS['lang'] ?? null) instanceof Rhymix\Framework\Lang))
|
||||
{
|
||||
$GLOBALS['lang'] = Rhymix\Framework\Lang::getInstance(self::$_instance->lang_type ?: config('locale.default_lang') ?: 'ko');
|
||||
$GLOBALS['lang']->loadDirectory(RX_BASEDIR . 'common/lang', 'common');
|
||||
|
|
@ -1104,10 +1104,10 @@ class Context
|
|||
}
|
||||
else
|
||||
{
|
||||
self::$_instance->request_method = $_SERVER['REQUEST_METHOD'];
|
||||
self::$_instance->request_method = $_SERVER['REQUEST_METHOD'] ?? 'GET';
|
||||
}
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST')
|
||||
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST')
|
||||
{
|
||||
// Set variables for XE compatibility.
|
||||
if (isset($_POST['_rx_ajax_compat']) && in_array($_POST['_rx_ajax_compat'], array('JSON', 'XMLRPC')))
|
||||
|
|
@ -1152,7 +1152,7 @@ class Context
|
|||
public static function setRequestArguments(array $router_args = [])
|
||||
{
|
||||
// Arguments detected by the router have precedence over GET/POST parameters.
|
||||
$request_args = $_SERVER['REQUEST_METHOD'] === 'GET' ? $_GET : $_POST;
|
||||
$request_args = ($_SERVER['REQUEST_METHOD'] ?? 'GET') === 'GET' ? $_GET : $_POST;
|
||||
if (count($router_args))
|
||||
{
|
||||
foreach ($router_args as $key => $val)
|
||||
|
|
@ -1162,7 +1162,7 @@ class Context
|
|||
}
|
||||
|
||||
// Set JSON and XMLRPC arguments.
|
||||
if($_SERVER['REQUEST_METHOD'] === 'POST' && !$_POST && !empty($GLOBALS['HTTP_RAW_POST_DATA']))
|
||||
if(isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST' && !$_POST && !empty($GLOBALS['HTTP_RAW_POST_DATA']))
|
||||
{
|
||||
$params = array();
|
||||
$request_method = self::getRequestMethod();
|
||||
|
|
@ -1217,7 +1217,7 @@ class Context
|
|||
*/
|
||||
private static function setUploadInfo()
|
||||
{
|
||||
if ($_SERVER['REQUEST_METHOD'] !== 'POST' || !$_FILES)
|
||||
if (!isset($_SERVER['REQUEST_METHOD']) || $_SERVER['REQUEST_METHOD'] !== 'POST' || !$_FILES)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -1406,7 +1406,7 @@ class Context
|
|||
self::$_instance->security_check = 'DENY ALL';
|
||||
}
|
||||
}
|
||||
elseif(in_array($key, array('search_target', 'search_keyword', 'xe_validator_id')) || $_SERVER['REQUEST_METHOD'] === 'GET')
|
||||
elseif(in_array($key, array('search_target', 'search_keyword', 'xe_validator_id')) || ($_SERVER['REQUEST_METHOD'] ?? 'GET') === 'GET')
|
||||
{
|
||||
$_val = escape($_val, false);
|
||||
if(ends_with('url', $key, false))
|
||||
|
|
@ -1639,7 +1639,7 @@ class Context
|
|||
$get_vars = array();
|
||||
}
|
||||
// Otherwise, only keep existing parameters that are safe.
|
||||
elseif ($_SERVER['REQUEST_METHOD'] !== 'GET')
|
||||
elseif (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] !== 'GET')
|
||||
{
|
||||
$preserve_vars = array('module', 'mid', 'act', 'page', 'document_srl', 'search_target', 'search_keyword');
|
||||
$preserve_keys = array_combine($preserve_vars, array_fill(0, count($preserve_vars), true));
|
||||
|
|
|
|||
|
|
@ -680,9 +680,11 @@ class FrontEndFileHandler extends Handler
|
|||
$dirname = substr($dirname, strlen(self::$assetdir) + 1);
|
||||
}
|
||||
$tmp = array_first(explode('/', strtr($dirname, '\\.', '//')));
|
||||
|
||||
$cssSortList = array('common' => -100000, 'layouts' => -90000, 'modules' => -80000, 'widgets' => -70000, 'addons' => -60000);
|
||||
$file->index += $cssSortList[$tmp];
|
||||
if ($tmp)
|
||||
{
|
||||
$cssSortList = array('common' => -100000, 'layouts' => -90000, 'modules' => -80000, 'widgets' => -70000, 'addons' => -60000);
|
||||
$file->index += isset($cssSortList[$tmp]) ? $cssSortList[$tmp] : 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -696,7 +698,7 @@ class FrontEndFileHandler extends Handler
|
|||
{
|
||||
return false;
|
||||
}
|
||||
elseif (strncmp($_SERVER['SERVER_PROTOCOL'], 'HTTP/2', 6) === 0)
|
||||
elseif (strncmp($_SERVER['SERVER_PROTOCOL'] ?? '', 'HTTP/2', 6) === 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
|
||||
class IpFilter
|
||||
{
|
||||
public function filter($ip_list, $ip = NULL)
|
||||
public static function filter($ip_list, $ip = NULL)
|
||||
{
|
||||
if(!$ip) $ip = \RX_CLIENT_IP;
|
||||
return Rhymix\Framework\Filters\IpFilter::inRanges($ip, $ip_list);
|
||||
}
|
||||
|
||||
public function validate($ip_list = array())
|
||||
public static function validate($ip_list = array())
|
||||
{
|
||||
return Rhymix\Framework\Filters\IpFilter::validateRanges($ip_list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -847,7 +847,7 @@ class TemplateHandler
|
|||
case 'js':
|
||||
if($doUnload)
|
||||
{
|
||||
$result = "Context::unloadFile('{$attr['target']}','{$attr['targetie']}');";
|
||||
$result = vsprintf("Context::unloadFile('%s', '%s');", [$attr['target'] ?? '', $attr['targetie'] ?? '']);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -619,7 +619,7 @@ class Validator
|
|||
case 'enum':
|
||||
return in_array($value, $rule['test']);
|
||||
case 'expr':
|
||||
if(is_callable($rule['func_test']))
|
||||
if(isset($rule['func_test']) && is_callable($rule['func_test']))
|
||||
{
|
||||
return $rule['func_test']($value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ class Formatter
|
|||
{
|
||||
$lines = preg_replace('!(<br />)+\s*$!', '', nl2br(escape(trim($text))));
|
||||
$lines = preg_split('!(<br />\s*)+<br />!', $lines);
|
||||
$result = '';
|
||||
foreach ($lines as $line)
|
||||
{
|
||||
$result .= "<p>\n" . trim($line) . "\n</p>\n";
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class SessionHelper
|
|||
{
|
||||
$oMemberModel = \MemberModel::getInstance();
|
||||
$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
|
||||
if (intval($member_info->member_srl) === $member_srl)
|
||||
if (isset($member_info->member_srl) && intval($member_info->member_srl) === $member_srl)
|
||||
{
|
||||
foreach (get_object_vars($member_info) as $key => $value)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class DBQueryParser extends BaseParser
|
|||
$attribs = self::_getAttributes($xml);
|
||||
$query = new DBQuery\Query;
|
||||
$query->name = $name ?: null;
|
||||
$query->type = strtoupper($attribs['action']) ?: 'SELECT';
|
||||
$query->type = strtoupper($attribs['action'] ?? '') ?: 'SELECT';
|
||||
$query->alias = $attribs['alias'] ?? null;
|
||||
if ($query->alias && !$query->name)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ class DBTableParser extends BaseParser
|
|||
{
|
||||
$index->type = strtoupper($index_info['type']);
|
||||
}
|
||||
elseif (toBool($index_info['unique']))
|
||||
elseif (isset($index_info['unique']) && toBool($index_info['unique']))
|
||||
{
|
||||
$index->type = 'UNIQUE';
|
||||
}
|
||||
|
|
@ -202,12 +202,12 @@ class DBTableParser extends BaseParser
|
|||
{
|
||||
$const_info = self::_getAttributes($const_info);
|
||||
$constraint = new DBTable\Constraint;
|
||||
$constraint->type = strtoupper($const_info['type']);
|
||||
$constraint->column = $const_info['column'] ?: null;
|
||||
$constraint->references = $const_info['references'] ?: null;
|
||||
$constraint->condition = $const_info['condition'] ?: null;
|
||||
$constraint->on_delete = $const_info['ondelete'] ?: $constraint->on_delete;
|
||||
$constraint->on_update = $const_info['onupdate'] ?: $constraint->on_update;
|
||||
$constraint->type = strtoupper($const_info['type'] ?? '');
|
||||
$constraint->column = ($const_info['column'] ?? null) ?: null;
|
||||
$constraint->references = ($const_info['references'] ?? null) ?: null;
|
||||
$constraint->condition = ($const_info['condition'] ?? null) ?: null;
|
||||
$constraint->on_delete = ($const_info['ondelete'] ?? null) ?: $constraint->on_delete;
|
||||
$constraint->on_update = ($const_info['onupdate'] ?? null) ?: $constraint->on_update;
|
||||
$table->constraints[] = $constraint;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -267,8 +267,8 @@ class Router
|
|||
$matches = array_filter($matches, 'is_string', \ARRAY_FILTER_USE_KEY);
|
||||
$allargs = array_merge($args, $matches, $route_info['extra_vars'] ?? []);
|
||||
$result->module = $allargs['module'] ?? '';
|
||||
$result->mid = $allargs['mid'] ?: '';
|
||||
$result->act = $allargs['act'] ?: '';
|
||||
$result->mid = ($allargs['mid'] ?? '') ?: '';
|
||||
$result->act = ($allargs['act'] ?? '') ?: '';
|
||||
$result->forwarded = false;
|
||||
$result->args = $allargs;
|
||||
return $result;
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ class Session
|
|||
public static function checkSSO($site_module_info)
|
||||
{
|
||||
// Abort if SSO is disabled, the visitor is a robot, or this is not a typical GET request.
|
||||
if ($_SERVER['REQUEST_METHOD'] !== 'GET' || !config('use_sso') || UA::isRobot() || in_array(\Context::get('act'), array('rss', 'atom')))
|
||||
if (!isset($_SERVER['REQUEST_METHOD']) || $_SERVER['REQUEST_METHOD'] !== 'GET' || !config('use_sso') || UA::isRobot() || in_array(\Context::get('act'), array('rss', 'atom')))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -509,11 +509,11 @@ class Session
|
|||
public static function close()
|
||||
{
|
||||
// Restore member_srl from XE-compatible variable if it has changed.
|
||||
if ($_SESSION['RHYMIX'] && $_SESSION['RHYMIX']['login'] !== intval($_SESSION['member_srl']))
|
||||
if (isset($_SESSION['RHYMIX']) && $_SESSION['RHYMIX'] && $_SESSION['RHYMIX']['login'] !== intval($_SESSION['member_srl']))
|
||||
{
|
||||
$_SESSION['RHYMIX']['login'] = intval($_SESSION['member_srl']);
|
||||
$_SESSION['RHYMIX']['login'] = intval($_SESSION['member_srl'] ?? 0);
|
||||
$_SESSION['RHYMIX']['last_login'] = time();
|
||||
$_SESSION['is_logged'] = (bool)$member_srl;
|
||||
$_SESSION['is_logged'] = (bool)($_SESSION['member_srl'] ?? 0);
|
||||
}
|
||||
|
||||
// Close the session and write it to disk.
|
||||
|
|
@ -725,7 +725,7 @@ class Session
|
|||
*/
|
||||
public static function getMemberSrl()
|
||||
{
|
||||
return $_SESSION['member_srl'] ?: ($_SESSION['RHYMIX']['login'] ?: false);
|
||||
return ($_SESSION['member_srl'] ?? 0) ?: (($_SESSION['RHYMIX']['login'] ?? false) ?: false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1016,7 +1016,7 @@ class Session
|
|||
*/
|
||||
public static function encrypt($plaintext)
|
||||
{
|
||||
$key = $_SESSION['RHYMIX']['secret'] . Config::get('crypto.encryption_key');
|
||||
$key = ($_SESSION['RHYMIX']['secret'] ?? '') . Config::get('crypto.encryption_key');
|
||||
return Security::encrypt($plaintext, $key);
|
||||
}
|
||||
|
||||
|
|
@ -1031,7 +1031,7 @@ class Session
|
|||
*/
|
||||
public static function decrypt($ciphertext)
|
||||
{
|
||||
$key = $_SESSION['RHYMIX']['secret'] . Config::get('crypto.encryption_key');
|
||||
$key = ($_SESSION['RHYMIX']['secret'] ?? '') . Config::get('crypto.encryption_key');
|
||||
return Security::decrypt($ciphertext, $key);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ class UA
|
|||
if (preg_match('#Android ([0-9\.]+);(?: ([^;]+) Build/)?#', $ua, $matches))
|
||||
{
|
||||
$result->os_version = $matches[1];
|
||||
$result->device = $matches[2] ?: null;
|
||||
$result->device = isset($matches[2]) ? ($matches[2] ?: null) : null;
|
||||
}
|
||||
}
|
||||
elseif ($matches[1] === 'iPhone' || $matches[1] === 'iPad' || $matches[1] === 'iPod')
|
||||
|
|
@ -358,7 +358,7 @@ class UA
|
|||
if (preg_match('#^([a-zA-Z0-9_-]+)(?:/([0-9]+\\.[0-9]+))?#', $ua, $matches))
|
||||
{
|
||||
$result->browser = ucfirst($matches[1]);
|
||||
$result->version = $matches[2] ?: null;
|
||||
$result->version = isset($matches[2]) ? ($matches[2] ?: null) : null;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class URL
|
|||
public static function modifyURL($url, array $changes = array())
|
||||
{
|
||||
$url = parse_url(self::getCanonicalURL($url));
|
||||
$prefix = sprintf('%s://%s%s%s', $url['scheme'], $url['host'], ($url['port'] ? (':' . $url['port']) : ''), $url['path']);
|
||||
$prefix = sprintf('%s://%s%s%s', $url['scheme'], $url['host'], (($url['port'] ?? '') ? (':' . $url['port']) : ''), $url['path']);
|
||||
parse_str($url['query'], $args);
|
||||
$changes = array_merge($args, $changes);
|
||||
$changes = array_filter($changes, function($val) { return $val !== null; });
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class memberModel extends member
|
|||
//for multi language
|
||||
foreach($config->signupForm AS $key=>$value)
|
||||
{
|
||||
$config->signupForm[$key]->title = ($value->isDefaultForm) ? lang($value->name) : $value->title;
|
||||
$config->signupForm[$key]->title = ($value->isDefaultForm ?? false) ? lang($value->name) : $value->title;
|
||||
if($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y';
|
||||
if($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use Codeception\Util\FileSystem;
|
|||
|
||||
class InstallHelper extends \Codeception\Module
|
||||
{
|
||||
public function _before()
|
||||
public function _before(\Codeception\TestInterface $test)
|
||||
{
|
||||
FileSystem::deleteDir('files');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class ContextTest extends \Codeception\TestCase\Test
|
|||
Context::setRequestMethod();
|
||||
Context::setRequestArguments();
|
||||
$this->assertEquals('POST', Context::getRequestMethod());
|
||||
$this->assertNull(Context::getRequestVars()->foo);
|
||||
$this->assertNull(Context::getRequestVars()->foo ?? null);
|
||||
$this->assertNull(Context::get('foo')); // This is different from XE behavior
|
||||
|
||||
$_SERVER['REQUEST_METHOD'] = 'POST';
|
||||
|
|
|
|||
|
|
@ -3,6 +3,11 @@
|
|||
class OldSecurityTest extends \Codeception\TestCase\Test
|
||||
{
|
||||
public function _before()
|
||||
{
|
||||
$this->_reset();
|
||||
}
|
||||
|
||||
protected function _reset()
|
||||
{
|
||||
/**
|
||||
* Setup mock data
|
||||
|
|
@ -40,13 +45,13 @@ class OldSecurityTest extends \Codeception\TestCase\Test
|
|||
$this->assertTrue(true);
|
||||
|
||||
// normal string - one
|
||||
$this->_before();
|
||||
$this->_reset();
|
||||
$this->assertEquals('<strong>Hello, world</strong>', Context::get('content1'));
|
||||
$security->encodeHTML('content1');
|
||||
$this->assertEquals('<strong>Hello, world</strong>', Context::get('content1'));
|
||||
|
||||
// normal string - two
|
||||
$this->_before();
|
||||
$this->_reset();
|
||||
$this->assertEquals('<strong>Hello, world</strong>', Context::get('content1'));
|
||||
$this->assertEquals('Wow, >_< !', Context::get('content2'));
|
||||
$security->encodeHTML('content1','content2');
|
||||
|
|
@ -61,7 +66,7 @@ class OldSecurityTest extends \Codeception\TestCase\Test
|
|||
$this->assertEquals(Context::get('array1'), array('<span class="first">F</span>irst','<u>S</u>econd','<b>T</b>hird'));
|
||||
$security->encodeHTML('array1.2'); // affects only third element
|
||||
$this->assertEquals(Context::get('array1'), array('<span class="first">F</span>irst','<u>S</u>econd','<b>T</b>hird'));
|
||||
$this->_before(); // reset;
|
||||
$this->_reset(); // reset;
|
||||
$this->assertEquals(Context::get('array1'), array('<span class="first">F</span>irst','<u>S</u>econd','<b>T</b>hird'));
|
||||
$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'));
|
||||
|
|
@ -74,7 +79,7 @@ class OldSecurityTest extends \Codeception\TestCase\Test
|
|||
$this->assertEquals(Context::get('array2'), array('elem1'=>'One <ins>1</ins>','elem2'=>'Two <del>2</del>','elem3'=>'Three <addr>3</addr>'));
|
||||
$security->encodeHTML('array2.elem2'); // affects only 'elem2'
|
||||
$this->assertEquals(Context::get('array2'), array('elem1'=>'One <ins>1</ins>','elem2'=>'Two <del>2</del>','elem3'=>'Three <addr>3</addr>'));
|
||||
$this->_before(); // reset;
|
||||
$this->_reset(); // reset;
|
||||
$this->assertEquals(Context::get('array2'), array('elem1'=>'One <ins>1</ins>','elem2'=>'Two <del>2</del>','elem3'=>'Three <addr>3</addr>'));
|
||||
$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>'));
|
||||
|
|
@ -94,7 +99,7 @@ class OldSecurityTest extends \Codeception\TestCase\Test
|
|||
$security->encodeHTML('object1.prop3'); // affects only 'prop3' property
|
||||
$obj->prop3 = '<strong>Strong</strong> Baby';
|
||||
$this->assertEquals(Context::get('object1'), $obj);
|
||||
$this->_before(); // reset
|
||||
$this->_reset(); // reset
|
||||
$obj->prop3 = '<strong>Strong</strong> Baby';
|
||||
$this->assertEquals(Context::get('object1'), $obj);
|
||||
$security->encodeHTML('object1.'); // affects all properties
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ class TemplateHandlerTest extends \Codeception\TestCase\Test
|
|||
// <!--%unload("../script.js",type="body")-->
|
||||
array(
|
||||
'<dummy /><!--%unload("../script.js",type="body")--><dummy />',
|
||||
'?><dummy /><?php Context::unloadFile(\'tests/unit/classes/script.js\',\'\'); ?><dummy />'
|
||||
'?><dummy /><?php Context::unloadFile(\'tests/unit/classes/script.js\', \'\'); ?><dummy />'
|
||||
),
|
||||
// comment
|
||||
array(
|
||||
|
|
@ -488,7 +488,7 @@ class TemplateHandlerTest extends \Codeception\TestCase\Test
|
|||
{
|
||||
$tmpl = new TemplateHandlerWrapper;
|
||||
$tmpl->init(__DIR__ . '/template', 'no_file.html');
|
||||
$result = $tmpl->parse($tpl);
|
||||
$result = $tmpl->parse(null);
|
||||
|
||||
$this->assertEquals('', $result);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
class DateTimeTest extends \Codeception\TestCase\Test
|
||||
{
|
||||
private $old_timezone;
|
||||
|
||||
public function _before()
|
||||
{
|
||||
// Add some dummy data to system configuration. Asia/Seoul offset is 32400.
|
||||
|
|
@ -9,14 +11,14 @@ class DateTimeTest extends \Codeception\TestCase\Test
|
|||
Rhymix\Framework\Config::set('locale.internal_timezone', 10800);
|
||||
|
||||
// Set PHP time zone to the internal time zone.
|
||||
$old_timezone = @date_default_timezone_get();
|
||||
$this->old_timezone = @date_default_timezone_get();
|
||||
date_default_timezone_set('Etc/GMT-3');
|
||||
}
|
||||
|
||||
public function _after()
|
||||
{
|
||||
// Restore the old timezone.
|
||||
date_default_timezone_set($old_timezone);
|
||||
date_default_timezone_set($this->old_timezone);
|
||||
}
|
||||
|
||||
public function testZgap()
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class RouterTest extends \Codeception\TestCase\Test
|
|||
$this->assertEquals($args, Rhymix\Framework\Router::parseURL('GET', 'board/comment/456/edit?extra_param=foo+bar', 2)->args);
|
||||
$this->assertEquals('board', Rhymix\Framework\Router::parseURL('GET', 'board/comment/456/edit?extra_param=foo+bar', 2)->mid);
|
||||
$this->assertEquals('dispBoardModifyComment', Rhymix\Framework\Router::parseURL('GET', 'board/comment/456/edit?extra_param=foo+bar', 2)->act);
|
||||
$this->assertEquals('', Rhymix\Framework\Router::parseURL('GET', 'board/comment/456/edit?extra_param=foo+bar', 2)->document_srl);
|
||||
$this->assertEquals('', Rhymix\Framework\Router::parseURL('GET', 'board/comment/456/edit?extra_param=foo+bar', 2)->document_srl ?? '');
|
||||
$this->assertEquals($args, Rhymix\Framework\Router::parseURL('GET', 'index.php?mid=board&act=dispBoardModifyComment&comment_srl=456&extra_param=foo+bar', 1)->args);
|
||||
$this->assertEquals($args, Rhymix\Framework\Router::parseURL('GET', 'index.php?mid=board&act=dispBoardModifyComment&comment_srl=456&extra_param=foo+bar', 0)->args);
|
||||
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ class SMSTest extends \Codeception\TestCase\Test
|
|||
$sms->send();
|
||||
|
||||
$messages = $driver->getSentMessages();
|
||||
$this->assertEquals('01099998888', $messages[0]->from);
|
||||
$this->assertEquals('01099998888', count($messages) ? $messages[0]->from : '');
|
||||
|
||||
config('sms.default_force', false);
|
||||
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ class SessionTest extends \Codeception\TestCase\Test
|
|||
|
||||
Rhymix\Framework\Session::destroy();
|
||||
$this->assertFalse(Rhymix\Framework\Session::verifyToken($token1));
|
||||
$this->assertFalse(Rhymix\Framework\Session::verifyToken($token, '/my/key'));
|
||||
$this->assertFalse(Rhymix\Framework\Session::verifyToken($token1, '/my/key'));
|
||||
$this->assertFalse(Rhymix\Framework\Session::getGenericToken());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,6 +63,6 @@ class LangParserTest extends \Codeception\TestCase\Test
|
|||
include \RX_BASEDIR . $this->_dir . '/ja.php';
|
||||
$this->assertEquals('テスト言語', $lang->testlang);
|
||||
$this->assertEquals('<p>HTML コンテンツ</p>', $lang->testhtml);
|
||||
$this->assertNull($lang->testarray);
|
||||
$this->assertNull($lang->testarray ?? null);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue