mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-18 23:15:21 +02:00
34 lines
650 B
PHP
34 lines
650 B
PHP
<?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
|
|
{
|
|
public function setUp(): void
|
|
{
|
|
$this->setUpSmarty(__DIR__);
|
|
}
|
|
|
|
/**
|
|
* test simple assignByRef
|
|
*/
|
|
public function testSimpleAssignByRef()
|
|
{
|
|
$bar = 'bar';
|
|
$this->smarty->assignByRef('foo', $bar);
|
|
$bar = 'newbar';
|
|
$this->assertEquals('newbar', $this->smarty->fetch('eval:{$foo}'));
|
|
}
|
|
}
|