Skip to content

Commit

Permalink
refactor the code style
Browse files Browse the repository at this point in the history
  • Loading branch information
xmujay committed Sep 15, 2013
1 parent 072d79b commit 130bff3
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions test/libraries/PMA_server_privileges_test.php
Expand Up @@ -232,7 +232,7 @@ public function testPMARangeOfUsers()
" WHERE `User` LIKE 'INIT%' OR `User` LIKE 'init%'",
$ret
);

$ret = PMA_rangeOfUsers();
$this->assertEquals(
'',
Expand Down Expand Up @@ -817,7 +817,7 @@ public function testPMAGetHtmlToDisplayPrivilegesTable()
. 'Create_user,Repl_slave,Repl_client',
'Type' => "'Super1','Select','Insert','Update','Create','Alter','Index',"
. "'Drop','Delete','File','Super','Process','Reload','Shutdown','"
. "Show_db','Repl_slave','Create_tmp_table',"
. "Show_db','Repl_slave','Create_tmp_table',"
. "'Show_view','Create_routine','"
. "Repl_client','Lock_tables','References','Alter_routine','"
. "Create_user','Repl_slave','Repl_client','Execute','Grant','ddd",
Expand Down Expand Up @@ -1077,11 +1077,11 @@ public function testPMAGetHtmlForDisplayLoginInformationFields()
$fetchValue = "fetchValue";
$dbi->expects($this->any())->method('fetchValue')
->will($this->returnValue($fetchValue));

$GLOBALS['dbi'] = $dbi;

$html = PMA_getHtmlForDisplayLoginInformationFields();
list($username_length, $hostname_length)
list($username_length, $hostname_length)
= PMA_getUsernameAndHostnameLength();

//validate 1: __('Login Information')
Expand All @@ -1101,7 +1101,7 @@ public function testPMAGetHtmlForDisplayLoginInformationFields()
__('Use text field'),
$html
);

$output = PMA_Util::showHint(
__(
'When Host table is used, this field is ignored '
Expand All @@ -1112,7 +1112,7 @@ public function testPMAGetHtmlForDisplayLoginInformationFields()
$output,
$html
);

$GLOBALS['dbi'] = $dbi_old;
}

Expand All @@ -1128,16 +1128,16 @@ public function testPMAGetWithClauseForAddUserAndUpdatePrivs()
$_POST['max_connections'] = 20;
$_POST['max_updates'] = 30;
$_POST['max_user_connections'] = 40;

$sql_query = PMA_getWithClauseForAddUserAndUpdatePrivs();
$expect = "WITH GRANT OPTION MAX_QUERIES_PER_HOUR 10 "
. "MAX_CONNECTIONS_PER_HOUR 20"
$expect = "WITH GRANT OPTION MAX_QUERIES_PER_HOUR 10 "
. "MAX_CONNECTIONS_PER_HOUR 20"
. " MAX_UPDATES_PER_HOUR 30 MAX_USER_CONNECTIONS 40";
$this->assertContains(
$expect,
$sql_query
);

}

/**
Expand All @@ -1163,7 +1163,7 @@ public function testPMAGetListOfPrivilegesAndComparedPrivileges()
$this->assertContains(
$expect,
$list_of_compared_privileges
);
);
}

/**
Expand All @@ -1186,9 +1186,9 @@ public function testPMAGetHtmlForAddUser()
);
$dbi->expects($this->any())->method('getColumns')
->will($this->returnValue($fields_info));

$GLOBALS['dbi'] = $dbi;

$dbname = "pma_dbname";

$html = PMA_getHtmlForAddUser($dbname);
Expand All @@ -1210,7 +1210,7 @@ public function testPMAGetHtmlForAddUser()
__('Database for user'),
$html
);

$item = PMA_Util::getCheckbox(
'createdb-2',
__('Grant all privileges on wildcard name (username\\_%).'),
Expand All @@ -1232,7 +1232,7 @@ public function testPMAGetHtmlForAddUser()
__('Go'),
$html
);

$GLOBALS['dbi'] = $dbi_old;
}

Expand All @@ -1256,9 +1256,9 @@ public function testPMAGetHtmlForSpecificDbPrivileges()
);
$dbi->expects($this->any())->method('getColumns')
->will($this->returnValue($fields_info));

$GLOBALS['dbi'] = $dbi;

$db = "pma_dbname";

$html = PMA_getHtmlForSpecificDbPrivileges($db);
Expand Down Expand Up @@ -1300,7 +1300,7 @@ public function testPMAGetHtmlForSpecificDbPrivileges()
__('Action'),
$html
);

//_pgettext('Create new user', 'New')
$this->assertContains(
_pgettext('Create new user', 'New'),
Expand All @@ -1310,7 +1310,7 @@ public function testPMAGetHtmlForSpecificDbPrivileges()
PMA_URL_getCommon(array('checkprivsdb' => $db)),
$html
);

$GLOBALS['dbi'] = $dbi_old;
}

Expand All @@ -1334,9 +1334,9 @@ public function testPMAGetHtmlForSpecificTablePrivileges()
);
$dbi->expects($this->any())->method('getColumns')
->will($this->returnValue($fields_info));

$GLOBALS['dbi'] = $dbi;

$db = "pma_dbname";
$table = "pma_table";

Expand Down Expand Up @@ -1385,7 +1385,7 @@ public function testPMAGetHtmlForSpecificTablePrivileges()
__('Action'),
$html
);

//_pgettext('Create new user', 'New')
$this->assertContains(
_pgettext('Create new user', 'New'),
Expand All @@ -1397,7 +1397,7 @@ public function testPMAGetHtmlForSpecificTablePrivileges()
),
$html
);

$GLOBALS['dbi'] = $dbi_old;
}
}

0 comments on commit 130bff3

Please sign in to comment.