Skip to content

Instantly share code, notes, and snippets.

@jsdecena
Created March 8, 2018 01:40
Show Gist options
  • Save jsdecena/34babe07b7ff4b24f2c3fb847fd0a0cf to your computer and use it in GitHub Desktop.
Save jsdecena/34babe07b7ff4b24f2c3fb847fd0a0cf to your computer and use it in GitHub Desktop.
Test Case File
<?php
namespace Tests;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Faker\Factory as Faker;
/**
* Class TestCase
* @package Tests
* @runTestsInSeparateProcesses
* @preserveGlobalState disabled
*/
abstract class TestCase extends BaseTestCase
{
use CreatesApplication, DatabaseMigrations, DatabaseTransactions;
protected $faker;
/**
* Set up the test
*/
public function setUp()
{
parent::setUp();
$this->faker = Faker::create();
}
/**
* Reset the migrations
*/
public function tearDown()
{
$this->artisan('migrate:reset');
parent::tearDown();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment