Smarty2 wrapper tests

This commit is contained in:
uwetews
2015-12-30 00:28:27 +01:00
parent 9ffad00177
commit d72ced4e70

View File

@@ -38,17 +38,6 @@ class RegisterFunctionTest extends PHPUnit_Smarty
$this->assertEquals('hello world 1', $this->smarty->fetch('string:{testfunction value=1}'));
}
/**
* test wrapper for register_function method
*/
public function testRegisterFunctionWrapper()
{
$this->smarty->register_function('testfunction', 'myfunction');
$this->assertEquals('myfunction',
$this->smarty->registered_plugins[ Smarty::PLUGIN_FUNCTION ][ 'testfunction' ][ 0 ]);
$this->assertEquals('hello world 12', $this->smarty->fetch('string:{testfunction value=12}'));
}
/**
* test SmartyBC for register_function method
*/
@@ -70,15 +59,6 @@ class RegisterFunctionTest extends PHPUnit_Smarty
$this->assertEquals('hello world 2', $this->smarty->fetch('string:{testfunction value=2}'));
}
/**
* test register_function wrapper method for function plugin by class
*/
public function testRegisterFunctionClassWrapper()
{
$this->smarty->register_function('testfunction', array('myfunctionclass', 'execute'));
$this->assertEquals('hello world 12', $this->smarty->fetch('string:{testfunction value=12}'));
}
/**
* test register_function SmartyBC method for function plugin by class
*/
@@ -98,16 +78,6 @@ class RegisterFunctionTest extends PHPUnit_Smarty
$this->assertEquals('hello world 3', $this->smarty->fetch('string:{testfunction value=3}'));
}
/**
* test register_function wrapper method for function plugin by object
*/
public function testRegisterFunctionObjectWrapper()
{
$myfunction_object = new myfunctionclass;
$this->smarty->register_function('testfunction', array($myfunction_object, 'execute'));
$this->assertEquals('hello world 13', $this->smarty->fetch('string:{testfunction value=13}'));
}
/**
* test register_function SmartyBC method for function plugin by object
*/
@@ -222,16 +192,6 @@ 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->register_function('testfunction', 'myfunction');
$this->smarty->unregister_function('testfunction');
$this->assertFalse(isset($this->smarty->registered_plugins[ Smarty::PLUGIN_FUNCTION ][ 'testfunction' ]));
}
public function testUnregisterFunctionSmartyBC()
{
$this->smartyBC->register_function('testfunction', 'myfunction');