mirror of
https://gitlab.com/omair-personal/exchange.git
synced 2026-08-19 04:24:08 +00:00
make all test pass
updated seeder to be informative fix seeder error on test
This commit is contained in:
@@ -21,6 +21,6 @@ $factory->define(App\User::class, function (Faker $faker) {
|
||||
'email' => $faker->unique()->safeEmail,
|
||||
'password' => $password ?: $password = bcrypt('secret'),
|
||||
'remember_token' => str_random(10),
|
||||
'marking' => $faker->name,
|
||||
'marking' => $faker->name,
|
||||
];
|
||||
});
|
||||
});
|
||||
@@ -132,21 +132,21 @@ class RolesAndPermissionsSeeder extends Seeder {
|
||||
}
|
||||
$this->command->info($commandBullet."Attached $pcount permissions to $role[name] role");
|
||||
|
||||
// Update old records
|
||||
if ($originalRole)
|
||||
{
|
||||
$userCount = 0;
|
||||
$RoleUsers = DB::table(Config::get('entrust.role_user_table'))->where('role_id',$originalRole->id)->get();
|
||||
foreach ($RoleUsers as $user) {
|
||||
$u = User::where('id',$user->user_id)->first();
|
||||
$u->attachRole($newRole);
|
||||
$userCount++;
|
||||
}
|
||||
$this->command->info($commandBullet."Updated role attachment for $userCount users");
|
||||
// Update old records : Temporary disabled
|
||||
// if ($originalRole)
|
||||
// {
|
||||
// $userCount = 0;
|
||||
// $RoleUsers = DB::table(Config::get('entrust.role_user_table'))->where('role_id',$originalRole->id)->get();
|
||||
// foreach ($RoleUsers as $user) {
|
||||
// $u = User::where('id',$user->user_id)->first();
|
||||
// $u->attachRole($newRole);
|
||||
// $userCount++;
|
||||
// }
|
||||
// $this->command->info($commandBullet."Updated role attachment for $userCount users");
|
||||
|
||||
Role::where('id',$originalRole->id)->delete(); // will also remove old role_user records
|
||||
$this->command->info($commandBullet."Removed the original $role[name] role");
|
||||
}
|
||||
// Role::where('id',$originalRole->id)->delete(); // will also remove old role_user records
|
||||
// $this->command->info($commandBullet."Removed the original $role[name] role");
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -15,13 +15,13 @@ class SettingActiveBankSeeder extends Seeder
|
||||
{
|
||||
$bankx1 = SettingMalaysiaBank::find(1);
|
||||
$bankx2 = SettingMalaysiaBank::find(2);
|
||||
$chinabank = SettingBeneficiary::where('acc_no', "=" ,'123456789')->first();
|
||||
$beneficiary = SettingBeneficiary::find(2);
|
||||
|
||||
DB::table('setting_active_banks')->truncate();
|
||||
DB::table('setting_active_banks')->insert([
|
||||
'x1_bank_id' => $bankx1->id,
|
||||
'x2_bank_id' => $bankx2->id,
|
||||
'beneficiary_id' => $chinabank->id
|
||||
'beneficiary_id' => $beneficiary->id
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class SettingBeneficiarySeeder extends Seeder
|
||||
'bank_branch' => 'Putra'
|
||||
]);
|
||||
DB::table('setting_beneficiaries')->insert([
|
||||
'company_name' => 'Bota',
|
||||
'company_name' => 'CIEF1',
|
||||
'bank_name' => 'CIMB',
|
||||
'acc_no' => '123456789',
|
||||
'bank_address' => 'Jalan cyberjaya',
|
||||
|
||||
@@ -13,9 +13,9 @@ class SettingCreditSeeder extends Seeder
|
||||
public function run()
|
||||
{
|
||||
DB::table('setting_credits')->insert([
|
||||
'rmb_credit_limit' => '4000',
|
||||
'usd_credit_limit' => '5000',
|
||||
'time_limit' => '6000'
|
||||
'rmb_credit_limit' => '100000',
|
||||
'usd_credit_limit' => '100000',
|
||||
'time_limit' => '60000'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class SettingTaxRateSeeder extends Seeder
|
||||
public function run()
|
||||
{
|
||||
DB::table('setting_tax_rates')->insert([
|
||||
'tax_rate' => '1.1',
|
||||
'tax_rate' => '1.0',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user