]> BookStack Code Mirror - bookstack/blobdiff - tests/TestCase.php
Merge pull request #3986 from BookStackApp/permission_testing
[bookstack] / tests / TestCase.php
index 70fd0da1d2719e90ead4389a51cde9d2db3794e9..9e4b1df419e5a3e9cbe158716f0ac2a2faf93344 100644 (file)
@@ -44,6 +44,10 @@ abstract class TestCase extends BaseTestCase
         $this->permissions = new PermissionsProvider($this->users);
 
         parent::setUp();
+
+        // We can uncomment the below to run tests with failings upon deprecations.
+        // Can't leave on since some deprecations can only be fixed upstream.
+         // $this->withoutDeprecationHandling();
     }
 
     /**
@@ -153,9 +157,12 @@ abstract class TestCase extends BaseTestCase
 
         DB::purge();
         config()->set('database.connections.mysql_testing.database', $database);
+        DB::beginTransaction();
 
         $callback();
 
+        DB::rollBack();
+
         if (is_null($originalVal)) {
             unset($_SERVER[$name]);
         } else {