'DC=example,DC=local', 'suffix' => 'example.local', 'servers' => ['localhost'], 'port' => 7636, 'admin_username' => 'vagrant', 'admin_password' => 'vagrant', 'encryption' => 'ssl', 'validate' => 'self', 'attributes' => ['mobile'], ], $conf ) ); return $client->getGroupHierarchyCache(); } public function testGetGroupList() { $ghc = $this->getClient(); $list = $this->callInaccessibleMethod($ghc, 'getGroupList', []); $this->assertGreaterThan(20, $list); $this->assertArrayHasKey('CN=Gamma Nested,CN=Users,DC=example,DC=local', $list); $this->assertArrayHasKey('parents', $list['CN=Gamma Nested,CN=Users,DC=example,DC=local']); $this->assertArrayHasKey('children', $list['CN=Gamma Nested,CN=Users,DC=example,DC=local']); } public function testGetParents() { $ghc = $this->getClient(); $this->assertEquals( [ 'CN=Gamma Nested,CN=Users,DC=example,DC=local', 'CN=beta,CN=Users,DC=example,DC=local', ], $ghc->getParents('CN=omega nested,CN=Users,DC=example,DC=local') ); } public function testGetChildren() { $ghc = $this->getClient(); $this->assertEquals( [ 'CN=Gamma Nested,CN=Users,DC=example,DC=local', 'CN=omega nested,CN=Users,DC=example,DC=local', ], $ghc->getChildren('CN=beta,CN=Users,DC=example,DC=local') ); } }