Move getBaseDN to Entry class, some cleanup

This commit is contained in:
Deon George
2020-09-21 22:20:59 +10:00
parent 4ef074fac4
commit 2a099e2dc4
5 changed files with 126 additions and 103 deletions

View File

@@ -7,7 +7,7 @@ use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
use App\Classes\LDAP\Server;
use App\Ldap\Entry;
class GetBaseDNTest extends TestCase
{
@@ -15,14 +15,15 @@ class GetBaseDNTest extends TestCase
* Test that we can get the Base DN of an LDAP server
*
* @return void
* @throws \LdapRecord\Models\ModelNotFoundException
* @covers \App\Ldap\Entry::baseDN()
*/
public function testBaseDNExists()
{
$o = new Server();
$x = $o->getBaseDN();
$o = (new Entry)->baseDN();
$this->assertIsObject($x);
$this->assertCount(1,$x->toArray());
$this->assertContains('dc=Test',$x->toArray());
$this->assertIsObject($o);
$this->assertCount(1,$o->toArray());
$this->assertContains('dc=Test',$o->toArray());
}
}

View File

@@ -15,7 +15,8 @@ class TranslateOidTest extends TestCase
* A basic feature test example.
*
* @return void
* @covers Server::getOID()
* @throws \LdapRecord\Models\ModelNotFoundException
* @covers \App\Classes\LDAP\Server::getOID()
*/
public function testRootDSE()
{