2020-08-23 02:30:18 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Unit;
|
|
|
|
|
2020-09-20 13:29:22 +00:00
|
|
|
use Tests\TestCase;
|
2020-08-23 02:30:18 +00:00
|
|
|
|
2023-02-19 05:35:07 +00:00
|
|
|
use App\Classes\LDAP\Server;
|
2020-08-23 02:30:18 +00:00
|
|
|
|
|
|
|
class GetBaseDNTest extends TestCase
|
|
|
|
{
|
2020-08-27 12:46:07 +00:00
|
|
|
/**
|
|
|
|
* Test that we can get the Base DN of an LDAP server
|
|
|
|
*
|
|
|
|
* @return void
|
2023-01-27 11:16:25 +00:00
|
|
|
* @throws \LdapRecord\Query\ObjectNotFoundException
|
2023-02-19 05:35:07 +00:00
|
|
|
* @covers \App\Classes\LDAP\Server::baseDNs()
|
2020-08-27 12:46:07 +00:00
|
|
|
*/
|
2023-01-27 11:16:25 +00:00
|
|
|
public function testBaseDnExists()
|
2020-08-27 12:46:07 +00:00
|
|
|
{
|
2023-02-19 05:35:07 +00:00
|
|
|
$o = Server::baseDNs();
|
2020-08-23 02:30:18 +00:00
|
|
|
|
2020-09-21 12:20:59 +00:00
|
|
|
$this->assertIsObject($o);
|
2023-01-27 11:16:25 +00:00
|
|
|
$this->assertCount(6,$o->toArray());
|
2021-12-03 02:36:25 +00:00
|
|
|
$this->assertEquals('dc=Test',$o->first()->getDn());
|
2020-08-23 02:30:18 +00:00
|
|
|
}
|
|
|
|
}
|