diff --git a/features/roles.feature b/features/roles.feature index 59643757..dc58658f 100644 --- a/features/roles.feature +++ b/features/roles.feature @@ -84,6 +84,19 @@ Feature: Manage WordPress roles Success: No roles needed resetting. """ + When I run `wp role reset --all custom-role author` + Then STDOUT should be: + """ + Custom role 'custom-role' not affected. + No changes necessary for 'administrator' role. + No changes necessary for 'editor' role. + No changes necessary for 'author' role. + No changes necessary for 'contributor' role. + No changes necessary for 'subscriber' role. + Success: No roles needed resetting. + """ + And STDERR should be empty + When I try `wp role reset custom-role` Then STDERR should contain: """ diff --git a/src/Role_Command.php b/src/Role_Command.php index 7b6df3d4..c059d333 100644 --- a/src/Role_Command.php +++ b/src/Role_Command.php @@ -295,6 +295,7 @@ public function reset( $args, $assoc_args ) { $before = []; if ( Utils\get_flag_value( $assoc_args, 'all' ) ) { + $args = []; foreach ( $default_roles as $role ) { $before[ $role ] = get_role( $role ); remove_role( $role );