1 | <?php |
||
2 | class LDAPFakeGateway extends LDAPGateway implements TestOnly |
||
|
|||
3 | { |
||
4 | public function __construct() |
||
8 | |||
9 | private static $data = array( |
||
10 | 'groups' => array( |
||
11 | 'CN=Users,DC=playpen,DC=local' => array( |
||
12 | array('dn' => 'CN=Group1,CN=Users,DC=playpen,DC=local'), |
||
13 | array('dn' => 'CN=Group2,CN=Users,DC=playpen,DC=local'), |
||
14 | array('dn' => 'CN=Group3,CN=Users,DC=playpen,DC=local'), |
||
15 | array('dn' => 'CN=Group4,CN=Users,DC=playpen,DC=local'), |
||
16 | array('dn' => 'CN=Group5,CN=Users,DC=playpen,DC=local') |
||
17 | ), |
||
18 | 'CN=Others,DC=playpen,DC=local' => array( |
||
19 | array('dn' => 'CN=Group6,CN=Others,DC=playpen,DC=local'), |
||
20 | array('dn' => 'CN=Group7,CN=Others,DC=playpen,DC=local'), |
||
21 | array('dn' => 'CN=Group8,CN=Others,DC=playpen,DC=local') |
||
22 | ) |
||
23 | ), |
||
24 | 'users' => array( |
||
25 | '123' => array( |
||
26 | 'distinguishedname' => 'CN=Joe,DC=playpen,DC=local', |
||
27 | 'objectguid' => '123', |
||
28 | 'cn' => 'jbloggs', |
||
29 | 'useraccountcontrol' => '1', |
||
30 | 'givenname' => 'Joe', |
||
31 | 'sn' => 'Bloggs', |
||
32 | 'mail' => '[email protected]' |
||
33 | ) |
||
34 | ) |
||
35 | ); |
||
36 | |||
37 | public function authenticate($username, $password) |
||
40 | |||
41 | public function getNodes($baseDn = null, $scope = Zend\Ldap\Ldap::SEARCH_SCOPE_SUB, $attributes = array(), $sort = '') |
||
44 | |||
45 | public function getGroups($baseDn = null, $scope = Zend\Ldap\Ldap::SEARCH_SCOPE_SUB, $attributes = array(), $sort = '') |
||
51 | |||
52 | public function getNestedGroups($dn, $baseDn = null, $scope = Zend\Ldap\Ldap::SEARCH_SCOPE_SUB, $attributes = array()) |
||
55 | |||
56 | public function getGroupByGUID($guid, $baseDn = null, $scope = Zend\Ldap\Ldap::SEARCH_SCOPE_SUB, $attributes = array()) |
||
59 | |||
60 | public function getUsers($baseDn = null, $scope = Zend\Ldap\Ldap::SEARCH_SCOPE_SUB, $attributes = array(), $sort = '') |
||
63 | |||
64 | public function getUserByGUID($guid, $baseDn = null, $scope = Zend\Ldap\Ldap::SEARCH_SCOPE_SUB, $attributes = array()) |
||
68 | |||
69 | public function update($dn, array $attributes) { |
||
71 | |||
72 | public function delete($dn, $recursively = false) { |
||
74 | |||
75 | public function move($fromDn, $toDn, $recursively = false) { |
||
77 | |||
78 | public function add($dn, array $attributes) { |
||
80 | |||
81 | } |
||
82 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.