diff options
| author | Simon Wisselink <wisskid@users.noreply.github.com> | 2024-03-28 11:22:29 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-28 11:22:29 +0100 |
| commit | 6f054ecc2ffea472b438691f42afcad598b98d61 (patch) | |
| tree | 44e5e8d839219dd0e926e9d55c02695102da85a5 /tests/UnitTests | |
| parent | 4fec27ccc274ff615df13612637160264b343bd9 (diff) | |
| download | smarty-6f054ecc2ffea472b438691f42afcad598b98d61.tar.gz smarty-6f054ecc2ffea472b438691f42afcad598b98d61.tar.bz2 smarty-6f054ecc2ffea472b438691f42afcad598b98d61.zip | |
Fix Smarty::assign() not returning when called with an array as first parameter. (#973)
Fixes #972
Diffstat (limited to 'tests/UnitTests')
| -rw-r--r-- | tests/UnitTests/SmartyMethodsTests/Assign/AssignTest.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/UnitTests/SmartyMethodsTests/Assign/AssignTest.php b/tests/UnitTests/SmartyMethodsTests/Assign/AssignTest.php index ea5f3a4b..e8ae92b7 100644 --- a/tests/UnitTests/SmartyMethodsTests/Assign/AssignTest.php +++ b/tests/UnitTests/SmartyMethodsTests/Assign/AssignTest.php @@ -42,4 +42,15 @@ class AssignTest extends PHPUnit_Smarty $this->smarty->assign(array('foo' => 'bar', 'foo2' => 'bar2')); $this->assertEquals('bar bar2', $this->smarty->fetch('eval:{$foo} {$foo2}')); } + + /** + * Test that assign returns this. + */ + public function testAssignReturnsThis() + { + $this->assertEquals( + 'data', + $this->smarty->assign(['dummy' => 'data'])->fetch('eval:{$dummy}') + ); + } } |
