Skip to content

Commit 3dac7fb

Browse files
Remove internal files from Git archive and cleanup comments. (#42)
* Update readme to reflect changes * Add .gitattributes file to export-ignore internal files * Replace deprecated assertions * Remove unencessary curly braces * Make user name one word in comment * Comment cleanup
1 parent a18c70a commit 3dac7fb

File tree

4 files changed

+38
-33
lines changed

4 files changed

+38
-33
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/.github export-ignore
2+
/drush export-ignore
3+
/tests export-ignore
4+
/travis.yml export-ignore
5+
/phpunit.xml.dist export-ignore

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
Drush commands to interact with multiple Drupal users.
55

66
## Requirements
7-
- Drush ^9.6 || ^10.2
8-
- Drupal 8
7+
- Drush ^11.0.5
8+
- Drupal ^9.3
99

1010
## Installation
1111
Since this is a [site-wide Drush command](https://docs.drush.org/en/master/commands/#site-wide-drush-commands), it will only be

UsersCommands.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class UsersCommands extends DrushCommands implements SiteAliasManagerAwareInterf
3737
* @bootstrap full
3838
* @field-labels
3939
* uid: User ID
40-
* name: User name
40+
* name: Username
4141
* pass: Password
4242
* mail: User mail
4343
* theme: User theme
@@ -261,7 +261,7 @@ public function toggle()
261261
* A flatter and simpler array presentation of a Drupal $user object.
262262
*
263263
* @param \Drupal\user\Entity\User $account
264-
* A user account.
264+
* A user account object.
265265
*
266266
* @return array
267267
*/

tests/ListTest.php

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ public function testAllUsers()
4141
$this->drush('users:list', []);
4242

4343
$output = $this->getOutput();
44-
$this->assertContains('foo', $output);
45-
$this->assertContains('bar', $output);
46-
$this->assertContains('admin', $output);
47-
$this->assertNotContains('anonymous', $output);
44+
$this->assertStringContainsString('foo', $output);
45+
$this->assertStringContainsString('bar', $output);
46+
$this->assertStringContainsString('admin', $output);
47+
$this->assertStringNotContainsString('anonymous', $output);
4848
}
4949

5050
/**
@@ -63,10 +63,10 @@ public function testUsersReturnedByMultipleRoles()
6363
);
6464

6565
$output = $this->getOutput();
66-
$this->assertContains('foo', $output);
67-
$this->assertContains('baz', $output);
68-
$this->assertNotContains('bar', $output);
69-
$this->assertNotContains('admin', $output);
66+
$this->assertStringContainsString('foo', $output);
67+
$this->assertStringContainsString('baz', $output);
68+
$this->assertStringNotContainsString('bar', $output);
69+
$this->assertStringNotContainsString('admin', $output);
7070
}
7171

7272
/**
@@ -85,9 +85,9 @@ public function testUsersReturnedByMultipleNoRoles()
8585
$this->drush('users:list', [], ['no-roles' => 'editor,publisher']);
8686

8787
$output = $this->getOutput();
88-
$this->assertContains('qux', $output);
89-
$this->assertNotContains('foo', $output);
90-
$this->assertNotContains('baz', $output);
88+
$this->assertStringContainsString('qux', $output);
89+
$this->assertStringNotContainsString('foo', $output);
90+
$this->assertStringNotContainsString('baz', $output);
9191
}
9292

9393
/**
@@ -102,9 +102,9 @@ public function testUsersReturnedByStatus()
102102
);
103103

104104
$output = $this->getOutput();
105-
$this->assertNotContains('foo', $output);
106-
$this->assertContains('bar', $output);
107-
$this->assertNotContains('admin', $output);
105+
$this->assertStringNotContainsString('foo', $output);
106+
$this->assertStringContainsString('bar', $output);
107+
$this->assertStringNotContainsString('admin', $output);
108108
}
109109

110110
/**
@@ -117,7 +117,7 @@ public function testUsersReturnedByLogin()
117117

118118
$this->drush(
119119
'sql:query',
120-
["UPDATE users_field_data SET login={$now} WHERE uid=1;"],
120+
["UPDATE users_field_data SET login=$now WHERE uid=1;"],
121121
);
122122

123123
$this->drush(
@@ -127,9 +127,9 @@ public function testUsersReturnedByLogin()
127127
);
128128

129129
$output = $this->getOutput();
130-
$this->assertContains('admin', $output);
131-
$this->assertNotContains('foo', $output);
132-
$this->assertNotContains('bar', $output);
130+
$this->assertStringContainsString('admin', $output);
131+
$this->assertStringNotContainsString('foo', $output);
132+
$this->assertStringNotContainsString('bar', $output);
133133
}
134134

135135
/**
@@ -148,10 +148,10 @@ public function testUsersReturnedByStatusRole()
148148
);
149149

150150
$output = $this->getOutput();
151-
$this->assertNotContains('foo', $output);
152-
$this->assertNotContains('bar', $output);
153-
$this->assertNotContains('admin', $output);
154-
$this->assertContains('baz', $output);
151+
$this->assertStringNotContainsString('foo', $output);
152+
$this->assertStringNotContainsString('bar', $output);
153+
$this->assertStringNotContainsString('admin', $output);
154+
$this->assertStringContainsString('baz', $output);
155155
}
156156

157157
/**
@@ -164,7 +164,7 @@ public function testUsersReturnedByStatusRoleLogin()
164164

165165
$this->drush(
166166
'sql:query',
167-
["UPDATE users_field_data SET login={$now} WHERE uid=1;"],
167+
["UPDATE users_field_data SET login=$now WHERE uid=1;"],
168168
);
169169

170170
// Create another administrator.
@@ -193,11 +193,11 @@ public function testUsersReturnedByStatusRoleLogin()
193193
);
194194

195195
$output = $this->getOutput();
196-
$this->assertNotContains('baz', $output);
197-
$this->assertNotContains('foo', $output);
196+
$this->assertStringNotContainsString('baz', $output);
197+
$this->assertStringNotContainsString('foo', $output);
198198

199-
// If baz is not in the output then 'admin' has to match user name.
200-
$this->assertContains('admin', $output);
199+
// If baz is not in the output then 'admin' has to match username.
200+
$this->assertStringContainsString('admin', $output);
201201
}
202202

203203
/**
@@ -215,7 +215,7 @@ public function testValidation()
215215
1
216216
);
217217

218-
$this->assertContains('Role garbage does not exist.', $this->getErrorOutput());
218+
$this->assertStringContainsString('Role garbage does not exist.', $this->getErrorOutput());
219219

220220
// Status 'garbage' does not exist;
221221
$this->drush(
@@ -227,6 +227,6 @@ public function testValidation()
227227
1
228228
);
229229

230-
$this->assertContains('Unknown status garbage.', $this->getErrorOutput());
230+
$this->assertStringContainsString('Unknown status garbage.', $this->getErrorOutput());
231231
}
232232
}

0 commit comments

Comments
 (0)