object = new Application_Octetstream_Hex(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 = 'Displays hexadecimal representation of data. Optional first' . ' parameter specifies how often space will be added (defaults' . ' to 2 nibbles).'; $this->assertEquals( $info, Application_Octetstream_Hex::getInfo() ); } /** * Test for getName * * @return void * * @group medium */ public function testGetName() { $this->assertEquals( "Hex", Application_Octetstream_Hex::getName() ); } /** * Test for getMIMEType * * @return void * * @group medium */ public function testGetMIMEType() { $this->assertEquals( "Application", Application_Octetstream_Hex::getMIMEType() ); } /** * Test for getMIMESubtype * * @return void * * @group medium */ public function testGetMIMESubtype() { $this->assertEquals( "OctetStream", Application_Octetstream_Hex::getMIMESubtype() ); } /** * Test for applyTransformation * * @return void * * @group medium */ public function testApplyTransformation() { $buffer = "11111001"; $options = array(3); $this->assertEquals( "313 131 313 130 303 1 ", $this->object->applyTransformation($buffer, $options) ); $buffer = "11111001"; $options = array(0); $this->assertEquals( "3131313131303031", $this->object->applyTransformation($buffer, $options) ); //no option $buffer = "11111001"; $this->assertEquals( "31 31 31 31 31 30 30 31 ", $this->object->applyTransformation($buffer) ); } }