mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-04 22:31:37 +01:00
34 lines
654 B
PHP
34 lines
654 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()
|
||
|
|
{
|
||
|
|
$this->setUpSmarty(dirname(__FILE__));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* test simple assignByRef
|
||
|
|
*/
|
||
|
|
public function testSimpleAssignByRef()
|
||
|
|
{
|
||
|
|
$bar = 'bar';
|
||
|
|
$this->smarty->assignByRef('foo', $bar);
|
||
|
|
$bar = 'newbar';
|
||
|
|
$this->assertEquals('newbar', $this->smarty->fetch('eval:{$foo}'));
|
||
|
|
}
|
||
|
|
}
|