diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionTest.php b/tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionTest.php index 5367a135..0ad025be 100644 --- a/tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionTest.php +++ b/tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionTest.php @@ -37,11 +37,11 @@ class RegisterFunctionTest extends PHPUnit_Smarty } /** - * test wrapper rfor egister_function method for function + * test wrapper for register_function method */ public function testRegisterFunctionWrapper() { - $this->smarty->registerPlugin(Smarty::PLUGIN_FUNCTION, 'testfunction', 'myfunction'); + $this->smarty->register_function('testfunction', 'myfunction'); $this->assertEquals('myfunction', $this->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['testfunction'][0]); $this->assertEquals('hello world 1', $this->smarty->fetch('eval:{testfunction value=1}')); } @@ -132,6 +132,16 @@ class RegisterFunctionTest extends PHPUnit_Smarty $this->assertFalse(isset($this->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['testfunction'])); } + /** + * test unregister_function method + */ + public function testUnregisterFunctionWrapper() + { + $this->smarty->registerPlugin(Smarty::PLUGIN_FUNCTION, 'testfunction', 'myfunction'); + $this->smarty->unregister_function('testfunction'); + $this->assertFalse(isset($this->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['testfunction'])); + } + /** * test unregister->templateFunction method not registered */