]> BookStack Code Mirror - bookstack/commitdiff
Performed fixes for failing tests on php8
authorDan Brown <redacted>
Sat, 20 Mar 2021 16:25:02 +0000 (16:25 +0000)
committerDan Brown <redacted>
Sat, 20 Mar 2021 16:25:02 +0000 (16:25 +0000)
- Commands that run a truncate DB action failed due to messing up the
  test transations so we mnaully work around that now to ensure a
transaction exists for the test to cleanup afterwards.
- Updated dompdf lib version

composer.json
composer.lock
tests/Commands/ClearActivityCommandTest.php
tests/Commands/ClearViewsCommandTest.php
tests/Commands/RegeneratePermissionsCommandTest.php

index acb6b260ea4265e64eb73e64722a33337c587a57..3e604b8fdfb29dd13cef6be681971ecdad0a9a9b 100644 (file)
@@ -12,7 +12,7 @@
         "ext-json": "*",
         "ext-mbstring": "*",
         "ext-xml": "*",
-        "barryvdh/laravel-dompdf": "^0.8.7",
+        "barryvdh/laravel-dompdf": "^0.9.0",
         "barryvdh/laravel-snappy": "^0.4.8",
         "doctrine/dbal": "^2.12.1",
         "facade/ignition": "^1.16.4",
index 9da2ef6641d446a70ba4ba2209960b1279da54ba..0a14f0d77d383150c3f9330fb4af5532de08ce0e 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "5b6d8f6e2d5594a7b0b5016c5fe284da",
+    "content-hash": "b26d29958d84c91b164a8234d1a7e9e9",
     "packages": [
         {
             "name": "aws/aws-sdk-php",
         },
         {
             "name": "barryvdh/laravel-dompdf",
-            "version": "v0.8.7",
+            "version": "v0.9.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/barryvdh/laravel-dompdf.git",
-                "reference": "30310e0a675462bf2aa9d448c8dcbf57fbcc517d"
+                "reference": "5b99e1f94157d74e450f4c97e8444fcaffa2144b"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/barryvdh/laravel-dompdf/zipball/30310e0a675462bf2aa9d448c8dcbf57fbcc517d",
-                "reference": "30310e0a675462bf2aa9d448c8dcbf57fbcc517d",
+                "url": "https://api.github.com/repos/barryvdh/laravel-dompdf/zipball/5b99e1f94157d74e450f4c97e8444fcaffa2144b",
+                "reference": "5b99e1f94157d74e450f4c97e8444fcaffa2144b",
                 "shasum": ""
             },
             "require": {
-                "dompdf/dompdf": "^0.8",
+                "dompdf/dompdf": "^1",
                 "illuminate/support": "^5.5|^6|^7|^8",
-                "php": ">=7"
+                "php": "^7.1 || ^8.0"
             },
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "0.8-dev"
+                    "dev-master": "0.9-dev"
                 },
                 "laravel": {
                     "providers": [
             ],
             "support": {
                 "issues": "https://github.com/barryvdh/laravel-dompdf/issues",
-                "source": "https://github.com/barryvdh/laravel-dompdf/tree/master"
+                "source": "https://github.com/barryvdh/laravel-dompdf/tree/v0.9.0"
             },
             "funding": [
                 {
                     "type": "github"
                 }
             ],
-            "time": "2020-09-07T11:50:18+00:00"
+            "time": "2020-12-27T12:05:53+00:00"
         },
         {
             "name": "barryvdh/laravel-snappy",
         },
         {
             "name": "dompdf/dompdf",
-            "version": "v0.8.6",
+            "version": "v1.0.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/dompdf/dompdf.git",
-                "reference": "db91d81866c69a42dad1d2926f61515a1e3f42c5"
+                "reference": "8768448244967a46d6e67b891d30878e0e15d25c"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/dompdf/dompdf/zipball/db91d81866c69a42dad1d2926f61515a1e3f42c5",
-                "reference": "db91d81866c69a42dad1d2926f61515a1e3f42c5",
+                "url": "https://api.github.com/repos/dompdf/dompdf/zipball/8768448244967a46d6e67b891d30878e0e15d25c",
+                "reference": "8768448244967a46d6e67b891d30878e0e15d25c",
                 "shasum": ""
             },
             "require": {
                 "ext-mbstring": "*",
                 "phenx/php-font-lib": "^0.5.2",
                 "phenx/php-svg-lib": "^0.3.3",
-                "php": "^7.1"
+                "php": "^7.1 || ^8.0"
             },
             "require-dev": {
                 "mockery/mockery": "^1.3",
-                "phpunit/phpunit": "^7.5",
+                "phpunit/phpunit": "^7.5 || ^8 || ^9",
                 "squizlabs/php_codesniffer": "^3.5"
             },
             "suggest": {
             "homepage": "https://github.com/dompdf/dompdf",
             "support": {
                 "issues": "https://github.com/dompdf/dompdf/issues",
-                "source": "https://github.com/dompdf/dompdf/tree/master"
+                "source": "https://github.com/dompdf/dompdf/tree/v1.0.2"
             },
-            "time": "2020-08-30T22:54:22+00:00"
+            "time": "2021-01-08T14:18:52+00:00"
         },
         {
             "name": "dragonmantank/cron-expression",
index 60f75675dace9877e6f4ecc6cace196a68b000a8..751a165c65c70e2085d9c598a1d816b3d4e2771b 100644 (file)
@@ -2,6 +2,7 @@
 
 use BookStack\Actions\ActivityType;
 use BookStack\Entities\Models\Page;
+use Illuminate\Support\Facades\DB;
 use Tests\TestCase;
 
 class ClearActivityCommandTest extends TestCase
@@ -18,7 +19,10 @@ class ClearActivityCommandTest extends TestCase
             'user_id' => $this->getEditor()->id
         ]);
 
+
+        DB::rollBack();
         $exitCode = \Artisan::call('bookstack:clear-activity');
+        DB::beginTransaction();
         $this->assertTrue($exitCode === 0, 'Command executed successfully');
 
 
index d553ead2e55c8038521d4ed156149f0f064b20b3..04665adcf2b384b200b2b728555b47e91a56168a 100644 (file)
@@ -1,6 +1,7 @@
 <?php namespace Tests\Commands;
 
 use BookStack\Entities\Models\Page;
+use Illuminate\Support\Facades\DB;
 use Tests\TestCase;
 
 class ClearViewsCommandTest extends TestCase
@@ -19,7 +20,9 @@ class ClearViewsCommandTest extends TestCase
             'views' => 1
         ]);
 
+        DB::rollBack();
         $exitCode = \Artisan::call('bookstack:clear-views');
+        DB::beginTransaction();
         $this->assertTrue($exitCode === 0, 'Command executed successfully');
 
         $this->assertDatabaseMissing('views', [
index 7965237efdb1d35ce4a5eb3ab5b8dce4272cd7da..d5b34ba170c4e8c41aaf826061f7df6646d93445 100644 (file)
@@ -2,12 +2,14 @@
 
 use BookStack\Auth\Permissions\JointPermission;
 use BookStack\Entities\Models\Page;
+use Illuminate\Support\Facades\DB;
 use Tests\TestCase;
 
 class RegeneratePermissionsCommandTest extends TestCase
 {
     public function test_regen_permissions_command()
     {
+        \DB::rollBack();
         JointPermission::query()->truncate();
         $page = Page::first();
 
@@ -15,6 +17,7 @@ class RegeneratePermissionsCommandTest extends TestCase
 
         $exitCode = \Artisan::call('bookstack:regenerate-permissions');
         $this->assertTrue($exitCode === 0, 'Command executed successfully');
+        DB::beginTransaction();
 
         $this->assertDatabaseHas('joint_permissions', ['entity_id' => $page->id]);
     }