update attribute test

This commit is contained in:
uwetews
2016-02-14 19:46:11 +01:00
parent a073234fe3
commit 3dcb718b5d
2 changed files with 32 additions and 1 deletions

View File

@@ -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}')));
}
}

View File

@@ -0,0 +1,20 @@
<?php
/**
* Smarty plugin params
*
* @package Smarty
* @subpackage PHPunitPlugin
*/
/**
* Smarty {gatparams}
*
* @param array $params parameter array
* @param object $template template object
*
* @return string
*/
function smarty_function_getparams($params, Smarty_Internal_Template $template)
{
return var_export($params, true);
}