Skip to content

Commit

Permalink
chore(tests): load environment from workbench directory
Browse files Browse the repository at this point in the history
Signed-off-by: Fery Wardiyanto <[email protected]>
  • Loading branch information
feryardiant committed May 9, 2024
1 parent cb80db8 commit ece7105
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 2 additions & 0 deletions testbench.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
providers:
- Creasi\Nusa\ServiceProvider
12 changes: 3 additions & 9 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
File renamed without changes.

0 comments on commit ece7105

Please sign in to comment.