mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 18:04:26 +02:00
PHP8.2 compatibility : Fixed unit tests
This commit is contained in:
@@ -22,7 +22,7 @@ class Smarty_Internal_Runtime_Make_Nocache
|
|||||||
{
|
{
|
||||||
if (isset($tpl->tpl_vars[ $var ])) {
|
if (isset($tpl->tpl_vars[ $var ])) {
|
||||||
$export =
|
$export =
|
||||||
preg_replace('/^Smarty_Variable::__set_state[(]|[)]$/', '', var_export($tpl->tpl_vars[ $var ], true));
|
preg_replace('/^\\\\?Smarty_Variable::__set_state[(]|[)]$/', '', var_export($tpl->tpl_vars[ $var ], true));
|
||||||
if (preg_match('/(\w+)::__set_state/', $export, $match)) {
|
if (preg_match('/(\w+)::__set_state/', $export, $match)) {
|
||||||
throw new SmartyException("{make_nocache \${$var}} in template '{$tpl->source->name}': variable does contain object '{$match[1]}' not implementing method '__set_state'");
|
throw new SmartyException("{make_nocache \${$var}} in template '{$tpl->source->name}': variable does contain object '{$match[1]}' not implementing method '__set_state'");
|
||||||
}
|
}
|
||||||
|
@@ -206,6 +206,7 @@ class StreamResourceTest extends PHPUnit_Smarty
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[AllowDynamicProperties]
|
||||||
class ResourceStream
|
class ResourceStream
|
||||||
{
|
{
|
||||||
private $position;
|
private $position;
|
||||||
|
@@ -391,6 +391,7 @@ class Security extends Smarty_Security
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#[AllowDynamicProperties]
|
||||||
class ResourceStreamSecurity
|
class ResourceStreamSecurity
|
||||||
{
|
{
|
||||||
private $position;
|
private $position;
|
||||||
|
@@ -15,6 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
class CompileRegisteredObjectFunctionTest extends PHPUnit_Smarty
|
class CompileRegisteredObjectFunctionTest extends PHPUnit_Smarty
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @var RegObject
|
||||||
|
*/
|
||||||
|
private $object;
|
||||||
|
|
||||||
public function setUp(): void
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
$this->setUpSmarty(__DIR__);
|
$this->setUpSmarty(__DIR__);
|
||||||
|
Reference in New Issue
Block a user