]> BookStack Code Mirror - bookstack/blobdiff - tests/TestCase.php
Updated code view block line highlighting to only show on focus
[bookstack] / tests / TestCase.php
index 70fd0da1d2719e90ead4389a51cde9d2db3794e9..abee1d3b3429756cd4173783eab2af35e6dabf5f 100644 (file)
@@ -23,6 +23,7 @@ use Monolog\Logger;
 use Psr\Http\Client\ClientInterface;
 use Ssddanbrown\AssertHtml\TestsHtml;
 use Tests\Helpers\EntityProvider;
+use Tests\Helpers\FileProvider;
 use Tests\Helpers\PermissionsProvider;
 use Tests\Helpers\TestServiceProvider;
 use Tests\Helpers\UserRoleProvider;
@@ -36,14 +37,20 @@ abstract class TestCase extends BaseTestCase
     protected EntityProvider $entities;
     protected UserRoleProvider $users;
     protected PermissionsProvider $permissions;
+    protected FileProvider $files;
 
     protected function setUp(): void
     {
         $this->entities = new EntityProvider();
         $this->users = new UserRoleProvider();
         $this->permissions = new PermissionsProvider($this->users);
+        $this->files = new FileProvider();
 
         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 +160,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 {