Merge pull request #416 from adamgsoc2013/UT_transform
add test for applyTransformation
This commit is contained in:
commit
1c0840ceae
@ -9,6 +9,8 @@
|
||||
* Include to test.
|
||||
*/
|
||||
|
||||
/* Each PluginObserver instance contains a PluginManager instance */
|
||||
require_once 'libraries/plugins/PluginManager.class.php';
|
||||
require_once 'libraries/plugins/transformations/Text_Plain_Append.class.php';
|
||||
|
||||
/**
|
||||
@ -18,7 +20,36 @@ require_once 'libraries/plugins/transformations/Text_Plain_Append.class.php';
|
||||
*/
|
||||
class Text_Plain_Append_Test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
/**
|
||||
* @access protected
|
||||
*/
|
||||
protected $object;
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
*
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = new Text_Plain_Append(new PluginManager());
|
||||
}
|
||||
|
||||
/**
|
||||
* Tears down the fixture, for example, closes a network connection.
|
||||
* This method is called after a test is executed.
|
||||
*
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
unset($this->object);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for getInfo
|
||||
*
|
||||
* @return void
|
||||
@ -80,4 +111,21 @@ class Text_Plain_Append_Test extends PHPUnit_Framework_TestCase
|
||||
Text_Plain_Append::getMIMESubtype()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for applyTransformation
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @group medium
|
||||
*/
|
||||
public function testApplyTransformation()
|
||||
{
|
||||
$buffer = "PMA_BUFFER";
|
||||
$options = array("option1", "option2");
|
||||
$this->assertEquals(
|
||||
"PMA_BUFFERoption1",
|
||||
$this->object->applyTransformation($buffer, $options)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user