mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 01:44:26 +02:00
PHP8.2 compatibility : Remove deprecated utf8_decode
This commit is contained in:
@@ -23,7 +23,7 @@ class PluginModifierCharsetTest extends PHPUnit_Smarty
|
||||
public function testToLatin1()
|
||||
{
|
||||
$encoded = "hällö wörld 1";
|
||||
$result = utf8_decode($encoded);
|
||||
$result = mb_convert_encoding($encoded, 'ISO-8859-1', 'UTF-8');
|
||||
$tpl = $this->smarty->createTemplate('string:{"' . $encoded . '"|to_charset}');
|
||||
$this->assertEquals(str_replace("\r", '', $result), $tpl->fetch());
|
||||
}
|
||||
@@ -33,7 +33,7 @@ class PluginModifierCharsetTest extends PHPUnit_Smarty
|
||||
Smarty::$_MBSTRING = false;
|
||||
$this->smarty->setCompileId('mb');
|
||||
$encoded = "hällö wörld 2";
|
||||
$result = utf8_decode($encoded);
|
||||
$result = mb_convert_encoding($encoded, 'ISO-8859-1', 'UTF-8');
|
||||
$tpl = $this->smarty->createTemplate('string:{"' . $encoded . '"|to_charset}');
|
||||
$this->assertEquals($encoded, $tpl->fetch());
|
||||
Smarty::$_MBSTRING = true;
|
||||
@@ -42,7 +42,7 @@ class PluginModifierCharsetTest extends PHPUnit_Smarty
|
||||
public function testFromLatin1()
|
||||
{
|
||||
$result = "hällö wörld 3";
|
||||
$encoded = utf8_decode($result);
|
||||
$encoded = mb_convert_encoding($result, 'ISO-8859-1', 'UTF-8');
|
||||
$tpl = $this->smarty->createTemplate('string:{"' . $encoded . '"|from_charset}');
|
||||
$this->assertEquals(str_replace("\r", '', $result), $tpl->fetch());
|
||||
}
|
||||
@@ -52,7 +52,7 @@ class PluginModifierCharsetTest extends PHPUnit_Smarty
|
||||
Smarty::$_MBSTRING = false;
|
||||
$this->smarty->setCompileId('mb');
|
||||
$result = "hällö wörld 4";
|
||||
$encoded = utf8_decode($result);
|
||||
$encoded = mb_convert_encoding($result, 'ISO-8859-1', 'UTF-8');
|
||||
$tpl = $this->smarty->createTemplate('string:{"' . $encoded . '"|from_charset}');
|
||||
$this->assertEquals($encoded, $tpl->fetch());
|
||||
Smarty::$_MBSTRING = true;
|
||||
|
@@ -203,7 +203,7 @@ class PluginModifierEscapeTest extends PHPUnit_Smarty
|
||||
public function testNonstdWithoutMbstring()
|
||||
{
|
||||
Smarty::$_MBSTRING = false;$this->smarty->setCompileId('mb');
|
||||
$tpl = $this->smarty->createTemplate('string:{"' . utf8_decode('sma\'rty@»example«.com') . '"|escape:"nonstd"}');
|
||||
$tpl = $this->smarty->createTemplate('string:{"' . mb_convert_encoding('sma\'rty@»example«.com', 'ISO-8859-1', 'UTF-8') . '"|escape:"nonstd"}');
|
||||
$this->assertEquals("sma'rty@»example«.com", $this->smarty->fetch($tpl));
|
||||
Smarty::$_MBSTRING = true;
|
||||
}
|
||||
|
@@ -68,6 +68,7 @@ class StreamVariableTest extends PHPUnit_Smarty
|
||||
// }
|
||||
}
|
||||
|
||||
#[AllowDynamicProperties]
|
||||
class VariableStream
|
||||
{
|
||||
private $position;
|
||||
|
Reference in New Issue
Block a user