Language: PHP
Label: vulnerable
CWE: CWE-281 \u2014 Improper Preservation of Permissions
The product does not preserve permissions or incorrectly preserves permissions when copying, restoring, or sharing objects, which can cause them to have less restrictive permissions than intended.

Code:
        $ugroup_with_restricted->shouldReceive('removeUser')->with(
            $restricted_user_in_ugroup_only,
            \Mockery::on(
                function (PFUser $user) {
                    return (int) $user->getId() === 0;
                }