2020-04-13 15:30:52 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Smarty PHPunit tests assignByRef method
|
|
|
|
*
|
|
|
|
* @package PHPunit
|
|
|
|
* @author Uwe Tews
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* class for assignByRef tests
|
|
|
|
*
|
|
|
|
* @runTestsInSeparateProcess
|
|
|
|
* @preserveGlobalState disabled
|
|
|
|
* @backupStaticAttributes enabled
|
|
|
|
*/
|
|
|
|
class AssignByRefTest extends PHPUnit_Smarty
|
|
|
|
{
|
2021-10-13 12:15:17 +02:00
|
|
|
public function setUp(): void
|
2020-04-13 15:30:52 +02:00
|
|
|
{
|
2022-09-27 13:03:34 +03:00
|
|
|
$this->setUpSmarty(__DIR__);
|
2020-04-13 15:30:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* test simple assignByRef
|
|
|
|
*/
|
|
|
|
public function testSimpleAssignByRef()
|
|
|
|
{
|
|
|
|
$bar = 'bar';
|
|
|
|
$this->smarty->assignByRef('foo', $bar);
|
|
|
|
$bar = 'newbar';
|
|
|
|
$this->assertEquals('newbar', $this->smarty->fetch('eval:{$foo}'));
|
|
|
|
}
|
|
|
|
}
|