Some minor code cleanup needed to pass coder

Also fixed tests to use token, we needs extended coverage:
1) block
2) API functions
3) admin UI

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andypost’s picture

FileSize
9.32 KB

Initial patch, fixed code-style and started tests (still not passes switch 404)

andypost’s picture

FileSize
10.55 KB

A bit extended test. I can't find a proper way to build a token

sun’s picture

Some good clean-ups here. Though do you think we could move forward with #1836516: Port Masquerade to D8 and rewrite + simplify it into a new 2.x series first?

+++ b/masquerade.module
@@ -252,6 +252,7 @@ function masquerade_menu_access($type, $uid = NULL) {
 function masquerade_admin_settings() {
+  drupal_set_message(user_access('masquerade as user') ? 'Allowed' : 'Disallowed');

?

+++ b/masquerade.module
@@ -359,14 +360,15 @@ function _masquerade_user_load($username) {
+    // @TODO Seems this useless.
     cache_clear_all($user->uid, 'cache_menu', TRUE);

Yep, also noticed those. Seem to date back to D5.

andypost’s picture

@sun thanx for review, this is a dubuggin staff - I'm trying to debug the session that should be fixed in #1555862: DrupalWebTestCase::drupalGetToken() does not add hash salt

patch includes additional cleanups from #1836516: Port Masquerade to D8 and rewrite + simplify it into a new 2.x series

andypost’s picture

The final patch I'm going to commit to D7

andypost’s picture

FileSize
15.7 KB

Another rount to pass tests

Status: Needs review » Needs work

The last submitted patch, 1835954-masquerade-6.patch, failed testing.