mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
Smarty2 wrapper tests
This commit is contained in:
@@ -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()
|
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('myfunction', $this->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['testfunction'][0]);
|
||||||
$this->assertEquals('hello world 1', $this->smarty->fetch('eval:{testfunction value=1}'));
|
$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']));
|
$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
|
* test unregister->templateFunction method not registered
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user