<?php namespace Laracasts\TestDummy;

use TestCase, Artisan, DB;

/**
 * Helper parent class for Laravel users.
 * Extend this class from your test classes.
 *
 * @package Laracasts\TestDummy
 */
class DbTestCase extends TestCase {

	/**
	 * Setup the DB before each test.
	 */
	public function setUp()
	{
		parent::setUp();

		// This should only do work for Sqlite DBs in memory.
		Artisan::call('migrate');

		// We'll run all tests through a transaction,
		// and then rollback afterward.
		DB::beginTransaction();
	}

	/**
	 * Rollback transactions after each test.
	 */
	public function tearDown()
	{
		DB::rollback();
	}

}
<?php namespace Laracasts\TestDummy;

use TestCase, Artisan, DB;

/**
 * Helper parent class for Laravel users.
 * Extend this class from your test classes.
 *
 * @package Laracasts\TestDummy
 */
class DbTestCase extends TestCase {

	/**
	 * Setup the DB before each test.
	 */
	public function setUp()
	{
		parent::setUp();

		// This should only do work for Sqlite DBs in memory.
		Artisan::call('migrate');

		// We'll run all tests through a transaction,
		// and then rollback afterward.
		DB::beginTransaction();
	}

	/**
	 * Rollback transactions after each test.
	 */
	public function tearDown()
	{
		parent::tearDown();

		DB::rollback();
	}

}
Call parent tearDown method to allow additional extension
Call parent tearDown method to allow additional extension
