public function testGetRdn() { LDAP\DN::setDefaultCaseFold(LDAP\DN::ATTR_CASEFOLD_NONE); $dnString = 'cn=Baker\\, Alice,cn=Users,dc=example,dc=com'; $dn = LDAP\DN::fromString($dnString); $this->assertEquals(array('cn' => 'Baker, Alice'), $dn->getRdn()); $this->assertEquals('cn=Baker\\, Alice', $dn->getRdnString()); $dnString = 'Cn=Users+Ou=Lab,dc=example,dc=com'; $dn = LDAP\DN::fromString($dnString); $this->assertEquals(array('Cn' => 'Users', 'Ou' => 'Lab'), $dn->getRdn()); $this->assertEquals('Cn=Users+Ou=Lab', $dn->getRdnString()); }