object = new Application_Octetstream_Download(new PluginManager());
global $row, $fields_meta;
$fields_meta = array();
$row = array("pma"=>"aaa", "pca"=>"bbb");
}
/**
* 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 a link to download the binary data of the column. You can'
. ' use the first option to specify the filename, or use the second'
. ' option as the name of a column which contains the filename. If'
. ' you use the second option, you need to set the first option to'
. ' the empty string.';
$this->assertEquals(
$info,
Application_Octetstream_Download::getInfo()
);
}
/**
* Test for getName
*
* @return void
*
* @group medium
*/
public function testGetName()
{
$this->assertEquals(
"Download",
Application_Octetstream_Download::getName()
);
}
/**
* Test for getMIMEType
*
* @return void
*
* @group medium
*/
public function testGetMIMEType()
{
$this->assertEquals(
"Application",
Application_Octetstream_Download::getMIMEType()
);
}
/**
* Test for getMIMESubtype
*
* @return void
*
* @group medium
*/
public function testGetMIMESubtype()
{
$this->assertEquals(
"OctetStream",
Application_Octetstream_Download::getMIMESubtype()
);
}
/**
* Test for applyTransformation
*
* @return void
*
* @group medium
*/
public function testApplyTransformation()
{
$buffer = "PMA_BUFFER";
$options = array("filename", 'wrapper_link'=>'PMA_wrapper_link');
$result = 'filename';
$this->assertEquals(
$result,
$this->object->applyTransformation($buffer, $options)
);
//using default filename: binary_file.dat
$options = array("", 'cloumn', 'wrapper_link'=>'PMA_wrapper_link');
$result = 'binary_file.dat';
$this->assertEquals(
$result,
$this->object->applyTransformation($buffer, $options)
);
}
}