Attendize/tests/TestCase.php

46 lines
1.0 KiB
PHP
Raw Normal View History

2016-02-29 15:59:36 +00:00
<?php
2016-04-26 23:08:27 +00:00
use App\Models\Timezone;
2016-03-05 00:18:10 +00:00
class TestCase extends Illuminate\Foundation\Testing\TestCase
{
2016-04-26 21:33:16 +00:00
/**
* The base URL to use while testing the application.
*
* @var string
*/
protected $baseUrl = 'http://localhost';
2016-03-05 00:18:10 +00:00
/**
* Creates the application.
*
* @return \Illuminate\Foundation\Application
*/
public function createApplication()
{
$app = require __DIR__.'/../bootstrap/app.php';
2016-04-26 23:08:27 +00:00
$app->loadEnvironmentFrom('.env.testing');
2016-04-26 21:33:16 +00:00
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
2016-03-05 00:18:10 +00:00
return $app;
}
2016-04-26 23:08:27 +00:00
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();
}
2016-04-26 21:33:16 +00:00
}