Ejemplo n.º 1
0
 /**
  * @group functional
  * @requires extension ldap
  */
 public function testLdapClientFunctional()
 {
     $config = $this->getLdapConfig();
     $ldap = new LdapClient($config['host'], $config['port']);
     $ldap->bind('cn=admin,dc=symfony,dc=com', 'symfony');
     $result = $ldap->find('dc=symfony,dc=com', '(&(objectclass=person)(ou=Maintainers))');
     $con = @ldap_connect($config['host'], $config['port']);
     @ldap_bind($con, 'cn=admin,dc=symfony,dc=com', 'symfony');
     $search = @ldap_search($con, 'dc=symfony,dc=com', '(&(objectclass=person)(ou=Maintainers))', array('*'));
     $expected = @ldap_get_entries($con, $search);
     $this->assertSame($expected, $result);
 }
Ejemplo n.º 2
0
 public function testLdapBind()
 {
     $this->ldap->expects($this->once())->method('bind')->with('foo', 'bar');
     $this->client->bind('foo', 'bar');
 }