summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon Wisselink <wisskid@users.noreply.github.com>2024-03-28 11:22:29 +0100
committerSimon Wisselink <s.wisselink@iwink.nl>2024-04-05 22:38:57 +0200
commit599bcee13ea7b305876191241be920a1c0fcf9b5 (patch)
tree5a8af17080369d0d16fe189b6124b8e11961bd1b /tests
parent569cef71d0fc45aeed260170c4ad66626d791161 (diff)
downloadsmarty-599bcee13ea7b305876191241be920a1c0fcf9b5.tar.gz
smarty-599bcee13ea7b305876191241be920a1c0fcf9b5.tar.bz2
smarty-599bcee13ea7b305876191241be920a1c0fcf9b5.zip
Fix Smarty::assign() not returning when called with an array as first parameter. (#973)
Fixes #972
Diffstat (limited to 'tests')
-rw-r--r--tests/UnitTests/SmartyMethodsTests/Assign/AssignTest.php11
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}')
+ );
+ }
}