You are here

public function ServerTest::testGetBasedn in Lightweight Directory Access Protocol (LDAP) 8.4

Test the Base DN.

File

ldap_servers/tests/src/Kernel/ServerTest.php, line 56

Class

ServerTest
@coversDefaultClass \Drupal\ldap_servers\Entity\Server @group ldap

Namespace

Drupal\Tests\ldap_servers\Kernel

Code

public function testGetBasedn() : void {
  $this->server
    ->set('basedn', []);
  self::assertEquals([], $this->server
    ->getBaseDn());
  $this->server
    ->set('basedn', [
    'ou=people,dc=hogwarts,dc=edu',
    'ou=groups,dc=hogwarts,dc=edu',
  ]);
  self::assertEquals('ou=groups,dc=hogwarts,dc=edu', $this->server
    ->getBaseDn()[1]);
  self::assertCount(2, $this->server
    ->getBaseDn());
}