From 210793e814c8efe67204db9b56116a15dc29961b Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 27 Jan 2023 22:16:25 +1100 Subject: [PATCH] Validate unit testing is working --- phpunit.xml | 24 +++++++++++------------- tests/Feature/ExampleTest.php | 5 +++-- tests/Unit/ExampleTest.php | 5 ++--- tests/Unit/GetBaseDNTest.php | 6 +++--- tests/Unit/TranslateOidTest.php | 4 ++-- 5 files changed, 21 insertions(+), 23 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index 9566b67..2ac86a1 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,33 +1,31 @@ - +> ./tests/Unit - ./tests/Feature - - + + ./app - - + + - + + + + diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php index 6ade73a..1eafba6 100644 --- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -2,6 +2,7 @@ namespace Tests\Feature; +// use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class ExampleTest extends TestCase @@ -11,9 +12,9 @@ class ExampleTest extends TestCase * * @return void */ - public function testBasicTest() + public function test_the_application_returns_a_successful_response() { - $response = $this->get('/home'); + $response = $this->get('/'); $response->assertStatus(200); } diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php index e9fe19c..e5c5fef 100644 --- a/tests/Unit/ExampleTest.php +++ b/tests/Unit/ExampleTest.php @@ -2,8 +2,7 @@ namespace Tests\Unit; -use Tests\TestCase; -use Illuminate\Foundation\Testing\RefreshDatabase; +use PHPUnit\Framework\TestCase; class ExampleTest extends TestCase { @@ -12,7 +11,7 @@ class ExampleTest extends TestCase * * @return void */ - public function testBasicTest() + public function test_that_true_is_true() { $this->assertTrue(true); } diff --git a/tests/Unit/GetBaseDNTest.php b/tests/Unit/GetBaseDNTest.php index d570533..b539d68 100644 --- a/tests/Unit/GetBaseDNTest.php +++ b/tests/Unit/GetBaseDNTest.php @@ -12,15 +12,15 @@ class GetBaseDNTest extends TestCase * Test that we can get the Base DN of an LDAP server * * @return void - * @throws \LdapRecord\Models\ModelNotFoundException + * @throws \LdapRecord\Query\ObjectNotFoundException * @covers \App\Ldap\Entry::baseDN() */ - public function testBaseDNExists() + public function testBaseDnExists() { $o = (new Entry)->baseDN(); $this->assertIsObject($o); - $this->assertCount(1,$o->toArray()); + $this->assertCount(6,$o->toArray()); $this->assertEquals('dc=Test',$o->first()->getDn()); } } diff --git a/tests/Unit/TranslateOidTest.php b/tests/Unit/TranslateOidTest.php index 2b7fb5b..4dca3b5 100644 --- a/tests/Unit/TranslateOidTest.php +++ b/tests/Unit/TranslateOidTest.php @@ -13,10 +13,10 @@ class TranslateOidTest extends TestCase * A basic feature test example. * * @return void - * @throws \LdapRecord\Models\ModelNotFoundException + * @throws \LdapRecord\Query\ObjectNotFoundException * @covers \App\Classes\LDAP\Server::getOID() */ - public function testRootDSE() + public function testRootDse() { $dse = (new Entry)->rootDSE();