diff --git a/test/libraries/PMA_operations_test.php b/test/libraries/PMA_operations_test.php new file mode 100644 index 0000000000..bea8d2d5ca --- /dev/null +++ b/test/libraries/PMA_operations_test.php @@ -0,0 +1,208 @@ +assertEquals( + PMA_getHtmlForDatabaseComment("pma"), + '
Database comment:
' + ); + } + + /** + * Test for PMA_getHtmlForRenameDatabase + */ + public function testPMA_getHtmlForRenameDatabase(){ + + $_REQUEST['db_collation'] = 'db1'; + $GLOBALS['cfg']['PropertiesIconic'] = true; + $this->assertEquals( + PMA_getHtmlForRenameDatabase("pma"), + '
+
Rename database to:
' + ); + } + + /** + * Test for PMA_getHtmlForDropDatabaseLink + */ + public function testPMA_getHtmlForDropDatabaseLink(){ + + $GLOBALS['cfg']['PropertiesIconic'] = true; + $this->assertEquals( + PMA_getHtmlForDropDatabaseLink("pma"), + '
Remove database
' + ); + } + + /** + * Test for PMA_getHtmlForCopyDatabase + */ + public function testPMA_getHtmlForCopyDatabase(){ + + $_REQUEST['db_collation'] = 'db1'; + $GLOBALS['cfg']['PropertiesIconic'] = true; + $this->assertEquals( + PMA_getHtmlForCopyDatabase("pma"), + '
+ +
Copy database to:
+
+ +
+ +
+



' + ); + } + + /** + * Test for PMA_getHtmlForChangeDatabaseCharset + */ + public function testPMA_getHtmlForChangeDatabaseCharset(){ + + $_REQUEST['db_collation'] = 'db1'; + $GLOBALS['cfg']['PropertiesIconic'] = true; + $this->assertEquals( + PMA_getHtmlForChangeDatabaseCharset("pma", "bookmark"), + '
+ + +
+
+
+' + ); + } + + /** + * Test for PMA_getHtmlForExportRelationalSchemaView + */ + public function testPMA_getHtmlForExportRelationalSchemaView(){ + + $GLOBALS['cfg']['PropertiesIconic'] = true; + $this->assertEquals( + PMA_getHtmlForExportRelationalSchemaView("id=001&name=pma"), + '
Edit or export relational schema
' + ); + } + + /** + * Test for PMA_getHtmlForOrderTheTable + */ + public function testPMA_getHtmlForOrderTheTable(){ + + $this->assertEquals( + PMA_getHtmlForOrderTheTable(array("column1", "column2")), + '
Alter table order by (singly)
' + ); + } + + /** + * Test for PMA_getHtmlForTableRow + */ + public function testPMA_getHtmlForTableRow(){ + + $this->assertEquals( + PMA_getHtmlForTableRow("name", "lable", "value"), + '' + ); + } + + /** + * Test for PMA_getMaintainActionlink + */ + public function testPMA_getMaintainActionlink(){ + + $this->assertEquals( + PMA_getMaintainActionlink("post", array("name", "value"), "lable", "value"), + '
  • postDocumentation
  • ' + ); + } + + /** + * Test for PMA_getHtmlForDeleteDataOrTable + */ + public function testPMA_getHtmlForDeleteDataOrTable(){ + + $this->assertEquals( + PMA_getHtmlForDeleteDataOrTable(array("truncate"), array("drop")), + '
    Delete data or table
    ' + ); + } + + /** + * Test for PMA_getDeleteDataOrTablelink + */ + public function testPMA_getDeleteDataOrTablelink(){ + + $this->assertEquals( + PMA_getDeleteDataOrTablelink(array("param"), "TRUNCATE_TABLE", "/phpmyadmin", 001), + '
  • /phpmyadminDocumentation
  • ' + ); + } + + /** + * Test for PMA_getHtmlForPartitionMaintenance + */ + public function testPMA_getHtmlForPartitionMaintenance(){ + + $this->assertEquals( + PMA_getHtmlForPartitionMaintenance(array("partition1", "partion2"), array("param1", "param2")), + '
    Partition maintenancePartition + + + + + + + + + + +Documentation
    Remove partitioning
    ' + ); + } + + /** + * Test for PMA_getHtmlForReferentialIntegrityCheck + */ + public function testPMA_getHtmlForReferentialIntegrityCheck(){ + + $this->assertEquals( + PMA_getHtmlForReferentialIntegrityCheck(array("foreign1", "foreign2"), array("param1", "param2")), + '
    Check referential integrity:
    ' + ); + } + + +}