From 64415ab4c173d39d1b09789f19f3a071bfbd5a85 Mon Sep 17 00:00:00 2001 From: adamgsoc2013 Date: Wed, 12 Jun 2013 18:23:30 +0800 Subject: [PATCH] add test for applyTransformation --- .../Text_Plain_Append_test.php | 50 ++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/test/classes/plugin/transformations/Text_Plain_Append_test.php b/test/classes/plugin/transformations/Text_Plain_Append_test.php index 6a033ecddb..37a5176881 100644 --- a/test/classes/plugin/transformations/Text_Plain_Append_test.php +++ b/test/classes/plugin/transformations/Text_Plain_Append_test.php @@ -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) + ); + } }