Skip to content

Commit 1b2da09

Browse files
committed
added multiple laravel migrations.
1 parent 19a7aa6 commit 1b2da09

File tree

5 files changed

+24
-7
lines changed

5 files changed

+24
-7
lines changed

phpunit.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
</testsuites>
4040
<php>
4141
<env name="APP_ENV" value="testing"/>
42+
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
4243
<env name="CACHE_DRIVER" value="array"/>
4344
<env name="SESSION_DRIVER" value="array"/>
4445
<env name="QUEUE_DRIVER" value="sync"/>

tests/DbTestCase.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,25 @@
77
class DbTestCase extends TestCase
88
{
99

10+
1011
protected array $migrations = [];
1112

1213
protected function setUp(): void
1314
{
1415
parent::setUp();
15-
$this->loadMigrationsFrom($this->getMigrations());
16+
$migrations = $this->getMigrations();
17+
foreach ($migrations as $migrationPath) {
18+
$this->loadMigrationsFrom($migrationPath);
19+
}
20+
1621
$this->loadLaravelMigrations(['--database' => env('DB_CONNECTION', 'mysql')]);
1722
}
1823

1924
public function getMigrations(): array
2025
{
2126
if (0 === count($this->migrations)) {
2227
$this->setMigrations([
23-
$this->resourceFolder.'/Database/Migrations/default/',
28+
$this->resourceFolder . 'Database/Migrations/Default/',
2429
]);
2530
}
2631
return $this->migrations;

tests/TestCase.php

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ abstract class TestCase extends OrchestraTestCase
1616
protected function setUp(): void
1717
{
1818
parent::setUp();
19-
$this->resourceFolder = __DIR__.'/Resources/';
19+
$this->resourceFolder = __DIR__ . '/Resources/';
2020
}
2121

2222
/**
23-
* @param Application $app
23+
* @param Application $app
2424
* @return array|string[]
2525
*/
2626
protected function getPackageProviders($app): array
@@ -31,7 +31,7 @@ protected function getPackageProviders($app): array
3131
}
3232

3333
/**
34-
* @param Application $app
34+
* @param Application $app
3535
* @return array
3636
*/
3737
protected function getPackageAliases($app): array
@@ -41,7 +41,7 @@ protected function getPackageAliases($app): array
4141
}
4242

4343
/**
44-
* @param Application $app
44+
* @param Application $app
4545
*/
4646
protected function getEnvironmentSetUp($app): void
4747
{
@@ -88,7 +88,7 @@ public function getDoctrineConnection(DatabaseManager $dbManager): Connection
8888
if (array_key_exists($dbConfig['name'], $dbMap)) {
8989
$dbConfig['driver'] = $dbMap[$dbConfig['name']];
9090
}
91-
91+
9292

9393
$connectionParams = [
9494
'dbname' => $dbConfig['database'],
@@ -100,4 +100,15 @@ public function getDoctrineConnection(DatabaseManager $dbManager): Connection
100100

101101
return DriverManager::getConnection($connectionParams);
102102
}
103+
104+
/**
105+
* Get the application timezone.
106+
*
107+
* @param \Illuminate\Foundation\Application $app
108+
* @return string|null
109+
*/
110+
protected function getApplicationTimezone($app): ?string
111+
{
112+
return 'Europe/Berlin';
113+
}
103114
}

0 commit comments

Comments
 (0)