spec/support/ldap_helpers.rb
def stub_ldap_person_find_by_uid(uid, entry, provider = 'ldapmain')
    return_value = ::Gitlab::LDAP::Person.new(entry, provider) if entry.present?

    allow(::Gitlab::LDAP::Person)
      .to receive(:find_by_uid).with(uid, any_args).and_return(return_value)
  end
# Stub an LDAP person search and provide the return entry. Specify `nil` for
# `entry` to simulate when an LDAP person is not found
#
# Example:
#  adapter = ::Gitlab::LDAP::Adapter.new('ldapmain', double(:ldap))
#  ldap_user_entry = ldap_user_entry('john_doe')
#
#  stub_ldap_person_find_by_uid('john_doe', ldap_user_entry, adapter)
Stub an LDAP person search and provide the return entry. Specify `nil` for
`entry` to simulate when an LDAP person is not found




Stub an LDAP person search and provide the return entry . Specify ` nil ` for ` entry ` to simulate when an LDAP person is not found
def stub_ldap_person_find_by_uid(uid, entry, provider = 'ldapmain')
    return_value = ::Gitlab::LDAP::Person.new(entry, provider) if entry.present?
    allow(::Gitlab::LDAP::Person)
      .to receive(:find_by_uid).with(uid, any_args).and_return(return_value)
  end
def stub_ldap_person_find_by_uid ( uid , entry , provider = 'ldapmain' ) return_value = :: Gitlab :: LDAP :: Person . new ( entry , provider ) if entry . present? allow ( :: Gitlab :: LDAP :: Person ) . to receive ( :find_by_uid ) . with ( uid , any_args ) . and_return ( return_value ) end
Stub an LDAP person search and provide the return entry.
Stub an LDAP person search and provide the return entry .
uid
entry
provider