-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestCase.php
48 lines (39 loc) · 1.24 KB
/
TestCase.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
namespace StarfolkSoftware\Gauge\Tests;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Orchestra\Testbench\TestCase as Orchestra;
use StarfolkSoftware\Gauge\GaugeServiceProvider;
class TestCase extends Orchestra
{
protected function setUp(): void
{
parent::setUp();
Factory::guessFactoryNamesUsing(
fn (string $modelName) => 'StarfolkSoftware\\Gauge\\Database\\Factories\\'.class_basename($modelName).'Factory'
);
}
protected function getPackageProviders($app)
{
return [
GaugeServiceProvider::class,
];
}
public function getEnvironmentSetUp($app)
{
config()->set('database.default', 'testing');
$migration = include __DIR__.'/../database/migrations/create_gauge_table.php.stub';
$migration->up();
Schema::create('teams', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->timestamps();
});
Schema::create('items', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->timestamps();
});
}
}