5 * Tests for role.drush.inc
14 class roleCase extends CommandUnishTestCase {
17 * Create, edit, block, and cancel users.
19 public function testRole() {
20 // In D8+, the testing profile has no perms.
21 $sites = $this->setUpDrupal(1, TRUE, UNISH_DRUPAL_MAJOR_VERSION, UNISH_DRUPAL_MAJOR_VERSION == 6 ? 'default' : 'standard');
22 $root = $this->webroot();
29 $anonymous = 'anonymous';
30 $authenticated = 'authenticated';
31 if (UNISH_DRUPAL_MAJOR_VERSION < 8) {
32 $anonymous .= ' user';
33 $authenticated .= ' user';
35 $this->drush('role-list', array($anonymous), $options + array('pipe' => NULL) );
36 $output = $this->getOutput();
37 $this->assertContains('access content', $output);
38 $this->drush('role-list', array($authenticated), $options + array('pipe' => NULL) );
39 $output = $this->getOutput();
40 $this->assertContains('access content', $output);
41 $this->drush('role-add-perm', array($anonymous, 'administer nodes'), $options );
42 $this->drush('role-list', array($anonymous), $options + array('pipe' => NULL) );
43 $output = $this->getOutput();
44 $this->assertContains('administer nodes', $output);
45 $this->drush('role-remove-perm', array($anonymous, 'administer nodes'), $options );
46 $this->drush('role-list', array($anonymous), $options + array('pipe' => NULL) );
47 $output = $this->getOutput();
48 $this->assertNotContains('administer nodes', $output);