Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

add test for applyTransformation #416

Merged
merged 1 commit into from

2 participants

@adamgsoc2013

No description provided.

@nijel nijel merged commit 1c0840c into phpmyadmin:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 12, 2013
  1. @adamgsoc2013
This page is out of date. Refresh to see the latest.
Showing with 49 additions and 1 deletion.
  1. +49 −1 test/classes/plugin/transformations/Text_Plain_Append_test.php
View
50 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 @@
*/
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 @@ public function testGetMIMESubtype()
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)
+ );
+ }
}
Something went wrong with that request. Please try again.