More unit testing, setup for localisation

This commit is contained in:
Deon George
2020-09-20 23:29:22 +10:00
parent b043e3bc93
commit 4ef074fac4
17 changed files with 501 additions and 154 deletions

View File

@@ -3,9 +3,9 @@
namespace Tests\Unit;
use Illuminate\Support\Collection;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
use App\Classes\LDAP\Server;

View File

@@ -0,0 +1,32 @@
<?php
namespace Tests\Unit;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
use App\Classes\LDAP\Server;
use App\Ldap\Entry;
class TranslateOidTest extends TestCase
{
/**
* A basic feature test example.
*
* @return void
* @covers Server::getOID()
*/
public function testRootDSE()
{
$dse = (new Entry)->rootDSE();
// Test our rootDSE returns an objectclass attribute
$this->assertIsArray($dse->objectclass);
// Test OID that exists
$this->assertStringContainsString('Subentries',Server::getOID('1.3.6.1.4.1.4203.1.10.1','title'));
// Test OID doesnt exist
$this->assertStringContainsString('9.9.9.9',Server::getOID('9.9.9.9','title'));
$this->assertNull(Server::getOID('9.9.9.9','ref'));
}
}