Fix for random invoice design in automated tests

This commit is contained in:
Hillel Coren 2016-05-22 16:55:25 +03:00
parent d0232e00f6
commit 0769ae9916

View File

@ -20,7 +20,7 @@ class UserTableSeeder extends Seeder
$faker = Faker\Factory::create(); $faker = Faker\Factory::create();
$company = Company::create(); $company = Company::create();
$account = Account::create([ $account = Account::create([
'name' => $faker->name, 'name' => $faker->name,
'address1' => $faker->streetAddress, 'address1' => $faker->streetAddress,
@ -28,12 +28,12 @@ class UserTableSeeder extends Seeder
'city' => $faker->city, 'city' => $faker->city,
'state' => $faker->state, 'state' => $faker->state,
'postal_code' => $faker->postcode, 'postal_code' => $faker->postcode,
'country_id' => Country::all()->random()->id, 'country_id' => Country::all()->random()->id,
'account_key' => str_random(RANDOM_KEY_LENGTH), 'account_key' => str_random(RANDOM_KEY_LENGTH),
'invoice_terms' => $faker->text($faker->numberBetween(50, 300)), 'invoice_terms' => $faker->text($faker->numberBetween(50, 300)),
'work_phone' => $faker->phoneNumber, 'work_phone' => $faker->phoneNumber,
'work_email' => $faker->safeEmail, 'work_email' => $faker->safeEmail,
'invoice_design_id' => min(InvoiceDesign::all()->random()->id, 10), 'invoice_design_id' => InvoiceDesign::where('id', '<', CUSTOM_DESIGN)->get()->random()->id,
'header_font_id' => min(Font::all()->random()->id, 17), 'header_font_id' => min(Font::all()->random()->id, 17),
'body_font_id' => min(Font::all()->random()->id, 17), 'body_font_id' => min(Font::all()->random()->id, 17),
'primary_color' => $faker->hexcolor, 'primary_color' => $faker->hexcolor,
@ -55,7 +55,7 @@ class UserTableSeeder extends Seeder
Affiliate::create([ Affiliate::create([
'affiliate_key' => SELF_HOST_AFFILIATE_KEY 'affiliate_key' => SELF_HOST_AFFILIATE_KEY
]); ]);
} }
} }