Skip to content

Commit dac06c0

Browse files
committed
update test case
1 parent 1d53e83 commit dac06c0

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/TestCase.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ protected function setUp(): void
2626
{
2727
parent::setUp();
2828

29+
$this->setUpDatabase();
30+
2931
Config::set('auth.providers.users', [
3032
'driver' => 'eloquent',
3133
'model' => User::class,
@@ -108,6 +110,16 @@ public function getEnvironmentSetUp($app): void
108110
'prefix' => '',
109111
]);
110112

113+
/**
114+
* Wallet configuration.
115+
*/
116+
Config::set('wallet.default_currency', 'RP');
117+
Config::set('wallet.table_names', [
118+
'balances' => 'lunar_rewards_balances',
119+
'balance_states' => 'lunar_rewards_balance_states',
120+
'transactions' => 'lunar_rewards_transactions',
121+
]);
122+
111123
Config::set('database.connections.mysql', [
112124
'driver' => 'mysql',
113125
'host' => 'mysql',
@@ -131,6 +143,24 @@ protected function defineDatabaseMigrations(): void
131143
$this->loadLaravelMigrations();
132144
}
133145

146+
/**
147+
* Set up the database.
148+
*/
149+
protected function setUpDatabase(): void
150+
{
151+
$walletMigrations = [
152+
'database/migrations/create_balances_table.php.stub',
153+
'database/migrations/create_transactions_table.php.stub',
154+
'database/migrations/create_balance_states_table.php.stub',
155+
];
156+
157+
foreach ($walletMigrations as $migration) {
158+
$migration = include __DIR__."/../vendor/021/laravel-wallet/{$migration}";
159+
160+
$migration->up();
161+
}
162+
}
163+
134164
/**
135165
* Resolve application HTTP exception handler implementation.
136166
*/

0 commit comments

Comments
 (0)