Skip to content

Instantly share code, notes, and snippets.

@agm1984
Created July 10, 2020 02:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agm1984/38d893e801ff257cc5da567a42e29fee to your computer and use it in GitHub Desktop.
Save agm1984/38d893e801ff257cc5da567a42e29fee to your computer and use it in GitHub Desktop.
Example of how to use the `DatabaseTransactions` Trait in Laravel.
<?php
namespace Tests;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
use CreatesApplication, DatabaseTransactions;
// your other stuff hence-forth
}
@agm1984
Copy link
Author

agm1984 commented Jul 10, 2020

This file exists alongside this sampler pack: https://gist.github.com/agm1984/7332c324165a020daa6ce6b91a437635

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment