began setting up test env
This commit is contained in:
parent
304b9c6e1f
commit
f897bc66de
|
|
@ -1,3 +1,4 @@
|
|||
/.env.testing
|
||||
/.phpstorm.meta.php
|
||||
/vendor
|
||||
/node_modules
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ $factory->define(App\Models\Account::class, function (Faker\Generator $faker) {
|
|||
|
||||
$factory->define(App\Models\User::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
'account_id' => $faker->randomDigit,
|
||||
'account_id' => factory(App\Models\Account::class)->create()->id,
|
||||
'first_name' => $faker->firstName,
|
||||
'last_name' => $faker->lastName,
|
||||
'phone' => $faker->phoneNumber,
|
||||
|
|
@ -270,7 +270,7 @@ $factory->define(App\Models\Attendee::class, function (Faker\Generator $faker) {
|
|||
];
|
||||
});
|
||||
|
||||
$faker->define(App\Models\Message::class, function (Faker\Generator $faker) {
|
||||
$factory->define(App\Models\Message::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
'message' => $faker->text,
|
||||
'subject' => $faker->text,
|
||||
|
|
@ -279,7 +279,7 @@ $faker->define(App\Models\Message::class, function (Faker\Generator $faker) {
|
|||
];
|
||||
});
|
||||
|
||||
$faker->define(App\Models\EventImage::class, function (Faker\Generator $faker) {
|
||||
$factory->define(App\Models\EventImage::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
'image_path' => $faker->imageUrl(),
|
||||
'event_id' => factory(App\Models\Event::class)->create()->id,
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ class CreateUsersTable extends Migration
|
|||
|
||||
$t->text('post_order_display_message')->nullable();
|
||||
|
||||
$t->text('social_share_text')->default('Check Out [event_title] - [event_url]');
|
||||
$t->text('social_share_text')->nullable();
|
||||
$t->boolean('social_show_facebook')->default(true);
|
||||
$t->boolean('social_show_linkedin')->default(true);
|
||||
$t->boolean('social_show_twitter')->default(true);
|
||||
|
|
|
|||
|
|
@ -18,5 +18,7 @@
|
|||
<env name="APP_ENV" value="testing"/>
|
||||
<env name="CACHE_DRIVER" value="array"/>
|
||||
<env name="SESSION_DRIVER" value="array"/>
|
||||
<env name="DB_HOST" value="176.58.123.120"/>
|
||||
<env name="DB_DATABASE" value="test"/>
|
||||
</php>
|
||||
</phpunit>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
<?php
|
||||
|
||||
use App\Models\Timezone;
|
||||
|
||||
class TestCase extends Illuminate\Foundation\Testing\TestCase
|
||||
{
|
||||
/**
|
||||
|
|
@ -15,7 +18,29 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
|
|||
public function createApplication()
|
||||
{
|
||||
$app = require __DIR__.'/../bootstrap/app.php';
|
||||
$app->loadEnvironmentFrom('.env.testing');
|
||||
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
|
||||
return $app;
|
||||
}
|
||||
|
||||
public function setUp(){
|
||||
parent::setUp();
|
||||
|
||||
\Artisan::call('migrate');
|
||||
if (Timezone::count() == 0) {
|
||||
\Artisan::call('db:seed', ['--force' => true]);
|
||||
}
|
||||
|
||||
factory(App\Models\User::class)->create([
|
||||
'email' => 'email@email.com',
|
||||
'password' => Hash::make('password'),
|
||||
]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function tearDown(){
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue