@@ -26,6 +26,8 @@ protected function setUp(): void
26
26
{
27
27
parent ::setUp ();
28
28
29
+ $ this ->setUpDatabase ();
30
+
29
31
Config::set ('auth.providers.users ' , [
30
32
'driver ' => 'eloquent ' ,
31
33
'model ' => User::class,
@@ -108,6 +110,16 @@ public function getEnvironmentSetUp($app): void
108
110
'prefix ' => '' ,
109
111
]);
110
112
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
+
111
123
Config::set ('database.connections.mysql ' , [
112
124
'driver ' => 'mysql ' ,
113
125
'host ' => 'mysql ' ,
@@ -131,6 +143,24 @@ protected function defineDatabaseMigrations(): void
131
143
$ this ->loadLaravelMigrations ();
132
144
}
133
145
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
+
134
164
/**
135
165
* Resolve application HTTP exception handler implementation.
136
166
*/
0 commit comments