Complete order tests messages, test that normal users can't access to the order ui admin screens and also include a case to test that users can't access to other user orders.

Comments

pcambra’s picture

rszrama’s picture

Status: Needs review » Fixed

I'm still getting fails on those same tests... I'll debug more later. In the meantime it might be nice if our users were created with meaningful names - i.e. instead of random characters, why not give the store admin user the name "Store admin" and normal user the name "Customer" or something?

pcambra’s picture

Retested with latest changes and all tests are passing for me, really don't know what could be failing, maybe we can debug this together this afternoon.

About the naming of the users, it could be a good thing to do, but the methods end calling drupalCreateUser, which always generates a random username
http://api.drupal.org/api/drupal/modules--simpletest--drupal_web_test_ca...

For generating user with specific names, we would need to clone drupalCreateUser method, which I don't see as a very good thing to do.

Another option would be to alter the name after creation, maybe altering our helper function to something like this

  protected function createUserWithPermissionHelper($set, $edit = array()) {
    $permissions = $this->permissionBuilder($set);
    $account = $this->drupalCreateUser($permissions);
    return empty($edit) ? $account : user_save($account, $edit);
  }
rszrama’s picture

That works for me. I may not be able to work with you on it this afternoon, though, b/c I reeeeally wanna package a beta before d.o goes down. : P

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.