From 3dcb718b5dab7c219bc3ae7d65c42407c327a505 Mon Sep 17 00:00:00 2001 From: uwetews Date: Sun, 14 Feb 2016 19:46:11 +0100 Subject: [PATCH] update attribute test --- .../TagTests/_Attributes/AttributeTest.php | 13 +++++++++++- .../PHPunitplugins/function.getparams.php | 20 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 tests/UnitTests/__shared/PHPunitplugins/function.getparams.php diff --git a/tests/UnitTests/TemplateSource/TagTests/_Attributes/AttributeTest.php b/tests/UnitTests/TemplateSource/TagTests/_Attributes/AttributeTest.php index f498adab..185ddc95 100644 --- a/tests/UnitTests/TemplateSource/TagTests/_Attributes/AttributeTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/_Attributes/AttributeTest.php @@ -18,6 +18,7 @@ class AttributeTest extends PHPUnit_Smarty public function setUp() { $this->setUpSmarty(dirname(__FILE__)); + $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); } @@ -48,7 +49,8 @@ class AttributeTest extends PHPUnit_Smarty /** * @expectedException SmartyCompilerException - * @expectedExceptionMessage illegal value of option flag "nocache" + * @expectedExceptionMessage for option flag 'nocache' + * @expectedExceptionMessage illegal value * test illegal option value */ public function testIllegalOptionValue() @@ -65,4 +67,13 @@ class AttributeTest extends PHPUnit_Smarty { $this->smarty->fetch('string:{assign foo 1 2}'); } + + /** + */ + public function testNumericParams() + { + $this->assertEquals('array(\'a\'=>\'pa\',0=>\'isnull\',)', $this->strip($this->smarty->fetch('string:{getparams a=\'pa\' 0=isnull}'))); + } + + } diff --git a/tests/UnitTests/__shared/PHPunitplugins/function.getparams.php b/tests/UnitTests/__shared/PHPunitplugins/function.getparams.php new file mode 100644 index 00000000..be1c26ab --- /dev/null +++ b/tests/UnitTests/__shared/PHPunitplugins/function.getparams.php @@ -0,0 +1,20 @@ +