diff --git a/test/classes/plugin/transformations/Text_Plain_Dateformat_test.php b/test/classes/plugin/transformations/Text_Plain_Dateformat_test.php
new file mode 100644
index 0000000000..dc677127ab
--- /dev/null
+++ b/test/classes/plugin/transformations/Text_Plain_Dateformat_test.php
@@ -0,0 +1,150 @@
+object = new Text_Plain_Dateformat(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 a TIME, TIMESTAMP, DATETIME or numeric unix timestamp'
+ . ' column as formatted date. The first option is the offset (in'
+ . ' hours) which will be added to the timestamp (Default: 0). Use'
+ . ' second option to specify a different date/time format string.'
+ . ' Third option determines whether you want to see local date or'
+ . ' UTC one (use "local" or "utc" strings) for that. According to'
+ . ' that, date format has different value - for "local" see the'
+ . ' documentation for PHP\'s strftime() function and for "utc" it'
+ . ' is done using gmdate() function.';
+
+ $this->assertEquals(
+ $info,
+ Text_Plain_Dateformat::getInfo()
+ );
+
+ }
+
+ /**
+ * Test for getName
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetName()
+ {
+ $this->assertEquals(
+ "Date Format",
+ Text_Plain_Dateformat::getName()
+ );
+ }
+
+ /**
+ * Test for getMIMEType
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetMIMEType()
+ {
+ $this->assertEquals(
+ "Text",
+ Text_Plain_Dateformat::getMIMEType()
+ );
+ }
+
+ /**
+ * Test for getMIMESubtype
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetMIMESubtype()
+ {
+ $this->assertEquals(
+ "Plain",
+ Text_Plain_Dateformat::getMIMESubtype()
+ );
+ }
+
+ /**
+ * Test for applyTransformation
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testApplyTransformation()
+ {
+ $timestamp = 12345;
+ $options = array(0);
+ $meta = new Text_Plain_Dateformat_Meta();
+ $meta->type = 'int';
+ $result = ''
+ . 'Jan 01, 1970 at 04:25 AM';
+ $this->assertEquals(
+ $result,
+ $this->object->applyTransformation($timestamp, $options, $meta)
+ );
+ }
+}
+
+class Text_Plain_Dateformat_Meta
+{
+ var $blob = null;
+ var $max_length = null;
+ var $type = null;
+}
\ No newline at end of file
diff --git a/test/classes/plugin/transformations/Text_Plain_Download_test.php b/test/classes/plugin/transformations/Text_Plain_Download_test.php
new file mode 100644
index 0000000000..0f132b968d
--- /dev/null
+++ b/test/classes/plugin/transformations/Text_Plain_Download_test.php
@@ -0,0 +1,138 @@
+object = new Application_Octetstream_Download(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 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)
+ );
+ }
+}
diff --git a/test/classes/plugin/transformations/Text_Plain_External_test.php b/test/classes/plugin/transformations/Text_Plain_External_test.php
new file mode 100644
index 0000000000..9a37cdcd81
--- /dev/null
+++ b/test/classes/plugin/transformations/Text_Plain_External_test.php
@@ -0,0 +1,142 @@
+object = new Text_Plain_External(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 =
+ 'LINUX ONLY: Launches an external application and feeds it the column'
+ . ' data via standard input. Returns the standard output of the'
+ . ' application. The default is Tidy, to pretty-print HTML code.'
+ . ' For security reasons, you have to manually edit the file'
+ . ' libraries/plugins/transformations/Text_Plain_External'
+ . '.class.php and list the tools you want to make available.'
+ . ' The first option is then the number of the program you want to'
+ . ' use and the second option is the parameters for the program.'
+ . ' The third option, if set to 1, will convert the output using'
+ . ' htmlspecialchars() (Default 1). The fourth option, if set to 1,'
+ . ' will prevent wrapping and ensure that the output appears all on'
+ . ' one line (Default 1).';
+ $this->assertEquals(
+ $info,
+ Text_Plain_External::getInfo()
+ );
+
+ }
+
+ /**
+ * Test for getName
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetName()
+ {
+ $this->assertEquals(
+ "External",
+ Text_Plain_External::getName()
+ );
+ }
+
+ /**
+ * Test for getMIMEType
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetMIMEType()
+ {
+ $this->assertEquals(
+ "Text",
+ Text_Plain_External::getMIMEType()
+ );
+ }
+
+ /**
+ * Test for getMIMESubtype
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetMIMESubtype()
+ {
+ $this->assertEquals(
+ "Plain",
+ Text_Plain_External::getMIMESubtype()
+ );
+ }
+
+ /**
+ * Test for applyTransformation
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testApplyTransformation()
+ {
+ $buffer = "PMA_BUFFER";
+ $options = array("/dev/null -i -wrap -q", "/dev/null -i -wrap -q");
+ $this->assertEquals(
+ "PMA_BUFFER",
+ $this->object->applyTransformation($buffer, $options)
+ );
+ }
+}
diff --git a/test/classes/plugin/transformations/Text_Plain_Formatted_test.php b/test/classes/plugin/transformations/Text_Plain_Formatted_test.php
new file mode 100644
index 0000000000..93484fd260
--- /dev/null
+++ b/test/classes/plugin/transformations/Text_Plain_Formatted_test.php
@@ -0,0 +1,133 @@
+object = new Text_Plain_Formatted(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 the contents of the column as-is, without running it'
+ . ' through htmlspecialchars(). That is, the column is assumed'
+ . ' to contain valid HTML.';
+ $this->assertEquals(
+ $info,
+ Text_Plain_Formatted::getInfo()
+ );
+
+ }
+
+ /**
+ * Test for getName
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetName()
+ {
+ $this->assertEquals(
+ "Formatted",
+ Text_Plain_Formatted::getName()
+ );
+ }
+
+ /**
+ * Test for getMIMEType
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetMIMEType()
+ {
+ $this->assertEquals(
+ "Text",
+ Text_Plain_Formatted::getMIMEType()
+ );
+ }
+
+ /**
+ * Test for getMIMESubtype
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetMIMESubtype()
+ {
+ $this->assertEquals(
+ "Plain",
+ Text_Plain_Formatted::getMIMESubtype()
+ );
+ }
+
+ /**
+ * Test for applyTransformation
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testApplyTransformation()
+ {
+ $buffer = "PMA_BUFFER";
+ $options = array("option1", "option2");
+ $this->assertEquals(
+ $buffer,
+ $this->object->applyTransformation($buffer, $options)
+ );
+ }
+}
diff --git a/test/classes/plugin/transformations/Text_Plain_Hex_test.php b/test/classes/plugin/transformations/Text_Plain_Hex_test.php
new file mode 100644
index 0000000000..138aac1b0b
--- /dev/null
+++ b/test/classes/plugin/transformations/Text_Plain_Hex_test.php
@@ -0,0 +1,140 @@
+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)
+ );
+ }
+}
diff --git a/test/classes/plugin/transformations/Text_Plain_Imagelink_test.php b/test/classes/plugin/transformations/Text_Plain_Imagelink_test.php
new file mode 100644
index 0000000000..7a88c08350
--- /dev/null
+++ b/test/classes/plugin/transformations/Text_Plain_Imagelink_test.php
@@ -0,0 +1,136 @@
+object = new Text_Plain_Imagelink(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 an image and a link; '
+ . 'the column contains the filename. The first option'
+ . ' is a URL prefix like "http://www.example.com/". The second and third options'
+ . ' are the width and the height in pixels.';
+ $this->assertEquals(
+ $info,
+ Text_Plain_Imagelink::getInfo()
+ );
+
+ }
+
+ /**
+ * Test for getName
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetName()
+ {
+ $this->assertEquals(
+ "Image Link",
+ Text_Plain_Imagelink::getName()
+ );
+ }
+
+ /**
+ * Test for getMIMEType
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetMIMEType()
+ {
+ $this->assertEquals(
+ "Text",
+ Text_Plain_Imagelink::getMIMEType()
+ );
+ }
+
+ /**
+ * Test for getMIMESubtype
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetMIMESubtype()
+ {
+ $this->assertEquals(
+ "Plain",
+ Text_Plain_Imagelink::getMIMESubtype()
+ );
+ }
+
+ /**
+ * Test for applyTransformation
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testApplyTransformation()
+ {
+ $buffer = "PMA_IMAGE";
+ $options = array("./image/", "200");
+ $result = ''
+ . '
PMA_IMAGE';
+ $this->assertEquals(
+ $result,
+ $this->object->applyTransformation($buffer, $options)
+ );
+ }
+}
diff --git a/test/classes/plugin/transformations/Text_Plain_Link_test.php b/test/classes/plugin/transformations/Text_Plain_Link_test.php
new file mode 100644
index 0000000000..39ba902a14
--- /dev/null
+++ b/test/classes/plugin/transformations/Text_Plain_Link_test.php
@@ -0,0 +1,135 @@
+object = new Text_Plain_Link(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 a link; the column contains the filename. The first option'
+ . ' is a URL prefix like "http://www.example.com/". The second option'
+ . ' is a title for the link.';
+ $this->assertEquals(
+ $info,
+ Text_Plain_Link::getInfo()
+ );
+
+ }
+
+ /**
+ * Test for getName
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetName()
+ {
+ $this->assertEquals(
+ "TextLink",
+ Text_Plain_Link::getName()
+ );
+ }
+
+ /**
+ * Test for getMIMEType
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetMIMEType()
+ {
+ $this->assertEquals(
+ "Text",
+ Text_Plain_Link::getMIMEType()
+ );
+ }
+
+ /**
+ * Test for getMIMESubtype
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetMIMESubtype()
+ {
+ $this->assertEquals(
+ "Plain",
+ Text_Plain_Link::getMIMESubtype()
+ );
+ }
+
+ /**
+ * Test for applyTransformation
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testApplyTransformation()
+ {
+ $buffer = "PMA_TXT_LINK";
+ $options = array("./php/", "text_name");
+ $result = 'text_name';
+ $this->assertEquals(
+ $result,
+ $this->object->applyTransformation($buffer, $options)
+ );
+ }
+}
diff --git a/test/classes/plugin/transformations/Text_Plain_Longtoipv4_test.php b/test/classes/plugin/transformations/Text_Plain_Longtoipv4_test.php
new file mode 100644
index 0000000000..be73fb9ea7
--- /dev/null
+++ b/test/classes/plugin/transformations/Text_Plain_Longtoipv4_test.php
@@ -0,0 +1,131 @@
+object = new Text_Plain_Longtoipv4(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 = 'Converts an (IPv4) Internet network address into a string in'
+ . ' Internet standard dotted format.';
+ $this->assertEquals(
+ $info,
+ Text_Plain_Longtoipv4::getInfo()
+ );
+
+ }
+
+ /**
+ * Test for getName
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetName()
+ {
+ $this->assertEquals(
+ "Long To IPv4",
+ Text_Plain_Longtoipv4::getName()
+ );
+ }
+
+ /**
+ * Test for getMIMEType
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetMIMEType()
+ {
+ $this->assertEquals(
+ "Text",
+ Text_Plain_Longtoipv4::getMIMEType()
+ );
+ }
+
+ /**
+ * Test for getMIMESubtype
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetMIMESubtype()
+ {
+ $this->assertEquals(
+ "Plain",
+ Text_Plain_Longtoipv4::getMIMESubtype()
+ );
+ }
+
+ /**
+ * Test for applyTransformation
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testApplyTransformation()
+ {
+ $buffer = 42949672;
+ $options = array("option1", "option2");
+ $this->assertEquals(
+ "2.143.92.40",
+ $this->object->applyTransformation($buffer, $options)
+ );
+ }
+}
diff --git a/test/classes/plugin/transformations/Text_Plain_Sql_test.php b/test/classes/plugin/transformations/Text_Plain_Sql_test.php
new file mode 100644
index 0000000000..c1d0903157
--- /dev/null
+++ b/test/classes/plugin/transformations/Text_Plain_Sql_test.php
@@ -0,0 +1,131 @@
+object = new Text_Plain_Sql(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 = 'Formats text as SQL query with syntax highlighting.';
+ $this->assertEquals(
+ $info,
+ Text_Plain_Sql::getInfo()
+ );
+
+ }
+
+ /**
+ * Test for getName
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetName()
+ {
+ $this->assertEquals(
+ "SQL",
+ Text_Plain_Sql::getName()
+ );
+ }
+
+ /**
+ * Test for getMIMEType
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetMIMEType()
+ {
+ $this->assertEquals(
+ "Text",
+ Text_Plain_Sql::getMIMEType()
+ );
+ }
+
+ /**
+ * Test for getMIMESubtype
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetMIMESubtype()
+ {
+ $this->assertEquals(
+ "Plain",
+ Text_Plain_Sql::getMIMESubtype()
+ );
+ }
+
+ /**
+ * Test for applyTransformation
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testApplyTransformation()
+ {
+ $buffer = "select *";
+ $options = array("option1", "option2");
+ $result = 'select *
';
+ $this->assertEquals(
+ $result,
+ $this->object->applyTransformation($buffer, $options)
+ );
+ }
+}
diff --git a/test/classes/plugin/transformations/Text_Plain_Substring_test.php b/test/classes/plugin/transformations/Text_Plain_Substring_test.php
new file mode 100644
index 0000000000..64c554e682
--- /dev/null
+++ b/test/classes/plugin/transformations/Text_Plain_Substring_test.php
@@ -0,0 +1,113 @@
+object = new Text_Plain_Substring(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 getName
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetName()
+ {
+ $this->assertEquals(
+ "Substring",
+ Text_Plain_Substring::getName()
+ );
+ }
+
+ /**
+ * Test for getMIMEType
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetMIMEType()
+ {
+ $this->assertEquals(
+ "Text",
+ Text_Plain_Substring::getMIMEType()
+ );
+ }
+
+ /**
+ * Test for getMIMESubtype
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testGetMIMESubtype()
+ {
+ $this->assertEquals(
+ "Plain",
+ Text_Plain_Substring::getMIMESubtype()
+ );
+ }
+
+ /**
+ * Test for applyTransformation
+ *
+ * @return void
+ *
+ * @group medium
+ */
+ public function testApplyTransformation()
+ {
+ $buffer = "PMA_BUFFER";
+ $options = array(1, 3, 'suffix');
+ $this->assertEquals(
+ "suffixMA_suffix",
+ $this->object->applyTransformation($buffer, $options)
+ );
+ }
+}