mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
update attribute test
This commit is contained in:
@@ -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}')));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
Reference in New Issue
Block a user