owncloud/core — pull request #4815 by blizzz (2013-09-11 20:51:27+00:00)
Title: WIP Don't merge! LDAP modularization and tests

What this PR brings:
- move ldap calls into a wrapper
- remove hardcoded Access dependency on user and group backend into a softcoded one
- on this basis: tests for the user backend

In general, it is part an consecutive and soft refactoring of the LDAP backend that started even before OC5.

There is an open issue where login is not possible when loginname and userid differ (default in LDAP Backend, if not configured otherwise). This is due to changes in the OC user/group management: https://github.com/owncloud/core/issues/4789

Background if you want to know more:
My initial thought was to move ldap calls out of direct calls and into a wrapper, to achieve mocking of the LDAP wrapper (to be able to test without an LDAP server) and for easier/better testing how the communication with the LDAP server behaves. While the latter was already fruitful (basis for one improvement in stable5) the first goal was not achieved because mocking an LDAP Wrapper is far too complex and error prone, if you also have in mind to test e.g. filter configurations or pages search. So this can only be done properly with real LDAP servers. Since I still want to test something I removed the hard binding of the Access class from the user- and group backend methods so I could mock Access and write first tests to at least check that user- methods behave properly.