diff --git a/libraries/operations.lib.php b/libraries/operations.lib.php index 5e59f27209..d915b0e4c0 100644 --- a/libraries/operations.lib.php +++ b/libraries/operations.lib.php @@ -56,7 +56,7 @@ function PMA_getHtmlForRenameDatabase($db) $html_output = '
' . '
'; if (isset($_REQUEST['db_collation'])) { $html_output .= '' - . __($action) + . $action . '' . PMA_CommonFunctions::getInstance()->showMySQLDocu($chapter, $link) . ''; @@ -1279,7 +1279,7 @@ function PMA_getDeleteDataOrTablelink($url_params, $syntax, $link, $id) return '
  • ' . $link . '' diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index 72c89a560e..61aad636fa 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -312,12 +312,12 @@ function PMA_getHtmlForDisplayColumnPrivileges($columns, $row, $name_for_select, foreach ($columns as $current_column => $current_column_privileges) { $html_output .= '
  • ' . "\n"; @@ -536,7 +536,7 @@ function PMA_getHtmlForDisplayResourceLimits($row) . '' . "\n" . '' . "\n" . '' . "\n"; @@ -550,8 +550,8 @@ function PMA_getHtmlForDisplayResourceLimits($row) . '' . "\n" . '' . "\n"; @@ -983,7 +983,7 @@ function PMA_getAdministrationPrivilegeTable($db) * Get HTML snippet for global privileges table with check boxes * * @param array $privTable privileges table array - * @param array $privTable_names names of the privilege tables + * @param array $privTable_names names of the privilege tables * (Data, Structure, Administration) * @param array $row first row from result or boolean false * @@ -995,7 +995,7 @@ function PMA_getHtmlForGlobalPrivTableWithCheckboxes( $html_output = ''; foreach ($privTable as $i => $table) { $html_output .= '
    ' . "\n" - . '' . __($privTable_names[$i]) . '' . "\n"; + . '' . $privTable_names[$i] . '' . "\n"; foreach ($table as $priv) { $html_output .= '
    ' . "\n" . '' . "\n" . '
    ' + $this->assertRegExp( + '/.*db_operations.php(.|[\n])*Database comment.*name="comment"([\n]|.)*/m', + PMA_getHtmlForDatabaseComment("pma") ); } @@ -37,11 +65,9 @@ class PMA_operations_test extends PHPUnit_Framework_TestCase public function testPMA_getHtmlForRenameDatabase(){ $_REQUEST['db_collation'] = 'db1'; - $GLOBALS['cfg']['PropertiesIconic'] = true; - $this->assertEquals( - PMA_getHtmlForRenameDatabase("pma"), - '
    -
    Rename database to:
    ' + $this->assertRegExp( + '/.*db_operations.php(.|[\n])*db_rename([\n]|.)*Rename database to.*/m', + PMA_getHtmlForRenameDatabase("pma") ); } @@ -50,10 +76,9 @@ class PMA_operations_test extends PHPUnit_Framework_TestCase */ public function testPMA_getHtmlForDropDatabaseLink(){ - $GLOBALS['cfg']['PropertiesIconic'] = true; - $this->assertEquals( - PMA_getHtmlForDropDatabaseLink("pma"), - '
    Remove database
    ' + $this->assertRegExp( + '/.*DROP.DATABASE.*db_operations.php.*Drop the database.*/', + PMA_getHtmlForDropDatabaseLink("pma") ); } @@ -63,18 +88,9 @@ class PMA_operations_test extends PHPUnit_Framework_TestCase public function testPMA_getHtmlForCopyDatabase(){ $_REQUEST['db_collation'] = 'db1'; - $GLOBALS['cfg']['PropertiesIconic'] = true; - $this->assertEquals( - PMA_getHtmlForCopyDatabase("pma"), - '
    - -
    Copy database to:
    -
    - -
    - -
    -



    ' + $this->assertRegExp( + '/.*db_operations.php(.|[\n])*db_copy([\n]|.)*Copy database to.*/m', + PMA_getHtmlForCopyDatabase("pma") ); } @@ -84,16 +100,9 @@ class PMA_operations_test extends PHPUnit_Framework_TestCase public function testPMA_getHtmlForChangeDatabaseCharset(){ $_REQUEST['db_collation'] = 'db1'; - $GLOBALS['cfg']['PropertiesIconic'] = true; - $this->assertEquals( - PMA_getHtmlForChangeDatabaseCharset("pma", "bookmark"), - '
    - - -
    -
    -
    -' + $this->assertRegExp( + '/.*db_operations.php(.|[\n])*select_db_collation([\n]|.)*Collation.*/m', + PMA_getHtmlForChangeDatabaseCharset("pma", "bookmark") ); } @@ -102,10 +111,9 @@ class PMA_operations_test extends PHPUnit_Framework_TestCase */ public function testPMA_getHtmlForExportRelationalSchemaView(){ - $GLOBALS['cfg']['PropertiesIconic'] = true; - $this->assertEquals( - PMA_getHtmlForExportRelationalSchemaView("id=001&name=pma"), - '
    Edit or export relational schema
    ' + $this->assertRegExp( + '/.*schema_edit.php.*Edit or export relational schema<.*/', + PMA_getHtmlForExportRelationalSchemaView("id=001&name=pma") ); } @@ -114,11 +122,9 @@ class PMA_operations_test extends PHPUnit_Framework_TestCase */ public function testPMA_getHtmlForOrderTheTable(){ - $this->assertEquals( - PMA_getHtmlForOrderTheTable(array("column1", "column2")), - '
    Alter table order by (singly)
    ' + $this->assertRegExp( + '/.*tbl_operations.php(.|[\n])*Alter table order by([\n]|.)*order_order.*/m', + PMA_getHtmlForOrderTheTable(array(array('Field' => "column1"), array('Field' => "column2"))) ); } @@ -128,8 +134,8 @@ class PMA_operations_test extends PHPUnit_Framework_TestCase public function testPMA_getHtmlForTableRow(){ $this->assertEquals( - PMA_getHtmlForTableRow("name", "lable", "value"), - '' + '', + PMA_getHtmlForTableRow("name", "lable", "value") ); } @@ -139,8 +145,8 @@ class PMA_operations_test extends PHPUnit_Framework_TestCase public function testPMA_getMaintainActionlink(){ $this->assertEquals( - PMA_getMaintainActionlink("post", array("name", "value"), "lable", "value"), - '
  • postDocumentation
  • ' + '
  • post
  • ', + PMA_getMaintainActionlink("post", array("name" => 'foo', "value" => 'bar'), array(), 'doclink') ); } @@ -149,9 +155,9 @@ class PMA_operations_test extends PHPUnit_Framework_TestCase */ public function testPMA_getHtmlForDeleteDataOrTable(){ - $this->assertEquals( - PMA_getHtmlForDeleteDataOrTable(array("truncate"), array("drop")), - '
    Delete data or table
    ' + $this->assertRegExp( + '/.*Delete data or table.*Empty the table.*Delete the table.*/m', + PMA_getHtmlForDeleteDataOrTable(array("truncate" => 'foo'), array("drop" => 'bar')) ); } @@ -160,9 +166,9 @@ class PMA_operations_test extends PHPUnit_Framework_TestCase */ public function testPMA_getDeleteDataOrTablelink(){ - $this->assertEquals( - PMA_getDeleteDataOrTablelink(array("param"), "TRUNCATE_TABLE", "/phpmyadmin", 001), - '
  • /phpmyadminDocumentation
  • ' + $this->assertRegExp( + '/.*TRUNCATE.TABLE.foo.*id_truncate.*Truncate table.*/m', + PMA_getDeleteDataOrTablelink(array("sql" => 'TRUNCATE TABLE foo'), "TRUNCATE_TABLE", "Truncate table", "id_truncate") ); } @@ -171,23 +177,9 @@ class PMA_operations_test extends PHPUnit_Framework_TestCase */ public function testPMA_getHtmlForPartitionMaintenance(){ - $this->assertEquals( - PMA_getHtmlForPartitionMaintenance(array("partition1", "partion2"), array("param1", "param2")), - '
    Partition maintenancePartition - - - - - - - - - - -Documentation
    Remove partitioning
    ' + $this->assertRegExp( + '/.*action="tbl_operations.php"(.|[\n])*ANALYZE([\n]|.)*REBUILD([\n]|.)*/m', + PMA_getHtmlForPartitionMaintenance(array("partition1", "partion2"), array("param1" => 'foo', "param2" => 'bar')) ); } @@ -196,11 +188,9 @@ class PMA_operations_test extends PHPUnit_Framework_TestCase */ public function testPMA_getHtmlForReferentialIntegrityCheck(){ - $this->assertEquals( - PMA_getHtmlForReferentialIntegrityCheck(array("foreign1", "foreign2"), array("param1", "param2")), - '
    Check referential integrity:
    ' + $this->assertRegExp( + '/.*Check referential integrity.*href="sql.php(.|[\n])*/m', + PMA_getHtmlForReferentialIntegrityCheck(array(array('foreign_table' => "foreign1", 'foreign_field' => "foreign2")), array("param1" => 'a', "param2" => 'b')) ); }