Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadhura Jayaratne <madhura.cj@gmail.com>2014-07-01 15:47:42 +0400
committerMadhura Jayaratne <madhura.cj@gmail.com>2014-07-01 15:47:42 +0400
commitb092ad5b57194a8f5a56c7ae9a202f00d0f2d74b (patch)
tree3fc57135a0bb01e2f33bc907d5ea24f56d25cf56
parentac41955eab3a8fbf66fd25f4fbe98619da23f583 (diff)
parent22748080ac1c7f25a38fafd8c69d22e20fc3f529 (diff)
Merge pull request #1263 from kb-yashodha/ut
Unit tests
-rw-r--r--libraries/designer.lib.php2
-rw-r--r--test/libraries/PMA_designer_test.php49
2 files changed, 50 insertions, 1 deletions
diff --git a/libraries/designer.lib.php b/libraries/designer.lib.php
index fe9b9d23e0..08d3a18c6f 100644
--- a/libraries/designer.lib.php
+++ b/libraries/designer.lib.php
@@ -189,7 +189,7 @@ function PMA_getHtmlForSchemaExport($db, $page)
if ($val == $GLOBALS['cfg']['PDFDefaultPageSize']) {
$htmlString .= ' selected="selected"';
}
- $htmlString .= ' >' . htmlspecialchars($val) . '</option>' . "\n";
+ $htmlString .= '>' . htmlspecialchars($val) . '</option>' . "\n";
}
$htmlString .= '</select>'
diff --git a/test/libraries/PMA_designer_test.php b/test/libraries/PMA_designer_test.php
index c5b7abe945..67ff982e80 100644
--- a/test/libraries/PMA_designer_test.php
+++ b/test/libraries/PMA_designer_test.php
@@ -32,6 +32,8 @@ class PMA_DesginerTest extends PHPUnit_Framework_TestCase
{
$GLOBALS['server'] = 1;
$GLOBALS['cfg']['ServerDefault'] = 1;
+ $GLOBALS['cfg']['PDFPageSizes'] = array('A3', 'A4');
+ $GLOBALS['cfg']['PDFDefaultPageSize'] = 'A4';
$_SESSION = array(
'relation' => array(
@@ -170,5 +172,52 @@ class PMA_DesginerTest extends PHPUnit_Framework_TestCase
$result
);
}
+
+ /**
+ * Test for PMA_getHtmlForSchemaExport()
+ *
+ * @return void
+ */
+ public function testGetHtmlForSchemaExport()
+ {
+ $db = 'db';
+ $page = 2;
+
+ $result = PMA_getHtmlForSchemaExport($db, $page);
+ // export type
+ $this->assertContains(
+ '<select name="export_type" id="export_type">',
+ $result
+ );
+
+ // hidden fields
+ $this->assertContains(
+ '<input type="hidden" name="do" value="process_export" />',
+ $result
+ );
+ $this->assertContains(
+ '<input type="hidden" name="chpage" value="' . $page . '" />',
+ $result
+ );
+
+ // orientation
+ $this->assertContains(
+ '<select name="orientation" id="orientation_opt" class="paper-change">',
+ $result
+ );
+ $this->assertContains('<option value="L">Landscape</option>', $result);
+ $this->assertContains('<option value="P">Portrait</option>', $result);
+
+ // paper size
+ $this->assertContains(
+ '<select name="paper" id="paper_opt" class="paper-change">',
+ $result
+ );
+ $this->assertContains('<option value="A3">A3</option>', $result);
+ $this->assertContains(
+ '<option value="A4" selected="selected">A4</option>',
+ $result
+ );
+ }
}
?> \ No newline at end of file