@@ -379,26 +379,6 @@ Feature: Manage WordPress users
379379 administrator
380380 """
381381
382- Scenario: Show error when trying to remove capability same as role
383- Given a WP install
384-
385- When I run `wp user create testuser2 [email protected] --first_name=test --last_name=user --role=contributor --porcelain` 386- Then STDOUT should be a number
387- And save STDOUT as {USER_ID}
388-
389- When I run `wp user list-caps {USER_ID}`
390- Then STDOUT should contain:
391- """
392- contributor
393- """
394-
395- When I run `wp user remove-cap {USER_ID} contributor`
396- Then the return code should be 1
397- And STDERR should be:
398- """
399- Error: There is a role similar to 'contributor' capability. Use `wp user remove-role` instead.
400- """
401-
402382 Scenario: Managing user capabilities
403383 Given a WP install
404384
@@ -452,6 +432,33 @@ Feature: Manage WordPress users
452432 publish_posts
453433 """
454434
435+ Scenario: Show error when trying to remove capability same as role
436+ Given a WP install
437+
438+ When I run `wp user create testuser2 [email protected] --first_name=test --last_name=user --role=contributor --porcelain` 439+ Then STDOUT should be a number
440+ And save STDOUT as {USER_ID}
441+
442+ When I run `wp user list-caps {USER_ID}`
443+ Then STDOUT should contain:
444+ """
445+ contributor
446+ """
447+
448+ When I run `wp user get {USER_ID} --field=roles`
449+ Then STDOUT should contain:
450+ """
451+ contributor
452+ """
453+
454+ When I try `wp user remove-cap {USER_ID} contributor`
455+ Then the return code should be 1
456+ And STDERR should be:
457+ """
458+ Error: There is a role similar to 'contributor' capability. Use `wp user remove-role` instead.
459+ """
460+ And STDOUT should be empty
461+
455462 Scenario: Show password when creating a user
456463 Given a WP install
457464
0 commit comments