codeception-email-mailhog icon indicating copy to clipboard operation
codeception-email-mailhog copied to clipboard

accessInboxFor - swapped parameters for array search

Open chudarek opened this issue 8 years ago • 2 comments

Hello.

When I am trying to access inbox with function accessInboxFor($inbox) error appears:

array_search() expects parameter 2 to be array, string given

It's caused by swapped parametres for array search:

array_search($email->Content->Headers->Cc[0], $addressPlusDelimiters)

Should be:

array_search($addressPlusDelimiters, $email->Content->Headers->Cc[0])

chudarek avatar Mar 14 '17 17:03 chudarek

I haven't used this code in quite a while (and only on a tiny pet project).

You're right that the needle and haystack are inverted, but that being said, shouldn't it be the entire Cc array that should be passed as a haystack?

ericmartel avatar Mar 14 '17 17:03 ericmartel

Yes. My bad. You're right.

chudarek avatar Mar 14 '17 17:03 chudarek