Commit 36ada855 authored by Christian Kuhn's avatar Christian Kuhn Committed by Wouter Wolters
Browse files

[TASK] Make GeneralUtility tests notice free

Resolves: #85871
Releases: master
Change-Id: Idca3e0bef85849eff4de818e0c736ac9aec281c2
Reviewed-on: https://review.typo3.org/57926


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
parent 19c73bdc
......@@ -189,7 +189,9 @@ class GeneralUtility
*/
public static function _GET($var = null)
{
$value = $var === null ? $_GET : (empty($var) ? null : $_GET[$var]);
$value = $var === null
? $_GET
: (empty($var) ? null : ($_GET[$var] ?? null));
// This is there for backwards-compatibility, in order to avoid NULL
if (isset($value) && !is_array($value)) {
$value = (string)$value;
......@@ -814,7 +816,9 @@ class GeneralUtility
*/
public static function isFirstPartOfStr($str, $partStr)
{
return $partStr != '' && strpos((string)$str, (string)$partStr, 0) === 0;
$str = is_array($str) ? '' : (string)$str;
$partStr = is_array($partStr) ? '' : (string)$partStr;
return $partStr !== '' && strpos($str, $partStr, 0) === 0;
}
/**
......
......@@ -47,11 +47,6 @@ class GeneralUtilityTest extends UnitTestCase
{
const NO_FIX_PERMISSIONS_ON_WINDOWS = 'fixPermissions() not available on Windows (method does nothing)';
/**
* Subject is not notice free, disable E_NOTICES
*/
protected static $suppressNotices = true;
/**
* @var bool Reset singletons created by subject
*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment