function let(RoleSet $role_set, Role $role, Permission $permission) { //fixtures $subject_id = 1; $permission->permission_id = 1; $permission->name = 'admin_view'; $permission->description = 'Admin View Permission'; //collaborator stubbing/mocking $permission->__toString()->willReturn($permission->name); $role_set->getRoles()->willReturn(array($role)); $role_set->getPermissions()->willReturn(array($permission)); $role_set->has_permission($permission)->willReturn(true); $this->beConstructedWith($subject_id, $role_set); }