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 * * @group medium */ public function testGetInfo() { $info = 'Appends text to a string. The only option is the text to be appended' . ' (enclosed in single quotes, default empty string).'; $this->assertEquals( $info, Text_Plain_Append::getInfo() ); } /** * Test for getName * * @return void * * @group medium */ public function testGetName() { $this->assertEquals( "Append", Text_Plain_Append::getName() ); } /** * Test for getMIMEType * * @return void * * @group medium */ public function testGetMIMEType() { $this->assertEquals( "Text", Text_Plain_Append::getMIMEType() ); } /** * Test for getMIMESubtype * * @return void * * @group medium */ public function testGetMIMESubtype() { $this->assertEquals( "Plain", 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) ); //no options $result = "PMA_BUFFER"; $this->assertEquals( $result, $this->object->applyTransformation($buffer) ); //html string $result = "PMA_BUFFER<a>abc</a>"; $options = array("abc"); $this->assertEquals( $result, $this->object->applyTransformation($buffer, $options) ); } }