From ece71059e2a9f3239bde6e07a5ea68296fcc3916 Mon Sep 17 00:00:00 2001 From: Fery Wardiyanto Date: Fri, 10 May 2024 02:07:32 +0700 Subject: [PATCH] chore(tests): load environment from workbench directory Signed-off-by: Fery Wardiyanto --- testbench.yaml | 2 ++ tests/TestCase.php | 12 +++--------- .env.example => workbench/.env.example | 0 3 files changed, 5 insertions(+), 9 deletions(-) create mode 100644 testbench.yaml rename .env.example => workbench/.env.example (100%) diff --git a/testbench.yaml b/testbench.yaml new file mode 100644 index 0000000..ea8849e --- /dev/null +++ b/testbench.yaml @@ -0,0 +1,2 @@ +providers: + - Creasi\Nusa\ServiceProvider diff --git a/tests/TestCase.php b/tests/TestCase.php index 3f82054..04ae83d 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -4,28 +4,22 @@ namespace Creasi\Tests; -use Creasi\Nusa\ServiceProvider; use Database\Seeders\DatabaseSeeder; use Illuminate\Config\Repository; use Illuminate\Foundation\Testing\DatabaseMigrations; +use Orchestra\Testbench\Concerns\WithWorkbench; use Orchestra\Testbench\TestCase as Orchestra; class TestCase extends Orchestra { use DatabaseMigrations; + use WithWorkbench; private static $shouldMigrate = true; - protected function getPackageProviders($app) - { - return [ - ServiceProvider::class, - ]; - } - protected function defineDatabaseMigrations() { - $nusa = \config('database.connections.nusa'); + $nusa = \config('database.connections.nusa', []); if (self::$shouldMigrate) { $this->recreateDatabase($nusa['database']); diff --git a/.env.example b/workbench/.env.example similarity index 100% rename from .env.example rename to workbench/.env.example