zendframework/zf2 — pull request #573 by dol (2011-11-07 23:20:20+00:00)
Title: Minor improvement: Cleaned up code that was introduced as bugfix to ZF-7289

The code is quite unreadable. This version replaces the double check of
ambiguity. The check and early return is already done by $this->_authenticateValidateResultSet($resultIdentities).

At the point of the check, loop over all identities (most time 1, due default of $_ambiguityIdentity = false) and
check if identity is valid. No need to check other identities.
If no valid identity was found, the latest result (failure) is returned.

Additionally:
- Fixed minor bug in test case. Check of $result2 was not done right. Copy/paste error.