diff options
author | Santo Cariotti <santo@dcariotti.me> | 2022-01-24 19:34:26 +0100 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2022-01-24 19:34:26 +0100 |
commit | 710f54c0156c5fa081bc6af1a68e7cb44723939b (patch) | |
tree | 056a85c362b7b9c5439506a76e0802e57342cc10 /Year_3/TSDWL/LARAVEL/iBook/tests | |
parent | b69d50c415ef1571bd42bb3eb1a1b3b38eab43dd (diff) |
add example in laravel
Diffstat (limited to 'Year_3/TSDWL/LARAVEL/iBook/tests')
4 files changed, 71 insertions, 0 deletions
diff --git a/Year_3/TSDWL/LARAVEL/iBook/tests/CreatesApplication.php b/Year_3/TSDWL/LARAVEL/iBook/tests/CreatesApplication.php new file mode 100644 index 0000000..547152f --- /dev/null +++ b/Year_3/TSDWL/LARAVEL/iBook/tests/CreatesApplication.php @@ -0,0 +1,22 @@ +<?php + +namespace Tests; + +use Illuminate\Contracts\Console\Kernel; + +trait CreatesApplication +{ + /** + * Creates the application. + * + * @return \Illuminate\Foundation\Application + */ + public function createApplication() + { + $app = require __DIR__.'/../bootstrap/app.php'; + + $app->make(Kernel::class)->bootstrap(); + + return $app; + } +} diff --git a/Year_3/TSDWL/LARAVEL/iBook/tests/Feature/ExampleTest.php b/Year_3/TSDWL/LARAVEL/iBook/tests/Feature/ExampleTest.php new file mode 100644 index 0000000..4ae02bc --- /dev/null +++ b/Year_3/TSDWL/LARAVEL/iBook/tests/Feature/ExampleTest.php @@ -0,0 +1,21 @@ +<?php + +namespace Tests\Feature; + +use Illuminate\Foundation\Testing\RefreshDatabase; +use Tests\TestCase; + +class ExampleTest extends TestCase +{ + /** + * A basic test example. + * + * @return void + */ + public function test_example() + { + $response = $this->get('/'); + + $response->assertStatus(200); + } +} diff --git a/Year_3/TSDWL/LARAVEL/iBook/tests/TestCase.php b/Year_3/TSDWL/LARAVEL/iBook/tests/TestCase.php new file mode 100644 index 0000000..2932d4a --- /dev/null +++ b/Year_3/TSDWL/LARAVEL/iBook/tests/TestCase.php @@ -0,0 +1,10 @@ +<?php + +namespace Tests; + +use Illuminate\Foundation\Testing\TestCase as BaseTestCase; + +abstract class TestCase extends BaseTestCase +{ + use CreatesApplication; +} diff --git a/Year_3/TSDWL/LARAVEL/iBook/tests/Unit/ExampleTest.php b/Year_3/TSDWL/LARAVEL/iBook/tests/Unit/ExampleTest.php new file mode 100644 index 0000000..62e8c3c --- /dev/null +++ b/Year_3/TSDWL/LARAVEL/iBook/tests/Unit/ExampleTest.php @@ -0,0 +1,18 @@ +<?php + +namespace Tests\Unit; + +use PHPUnit\Framework\TestCase; + +class ExampleTest extends TestCase +{ + /** + * A basic test example. + * + * @return void + */ + public function test_example() + { + $this->assertTrue(true); + } +} |