Skip to content

NOW MANAGED ON CODEBERG

Performed fixes for failing tests on php8

Dan Brown8e5067ee9158
diff --git a/composer.json b/composer.json
index acb6b260e..3e604b8fd 100644
--- a/composer.json
+++ b/composer.json
@@ -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",
diff --git a/composer.lock b/composer.lock
index 9da2ef664..0a14f0d77 100644
--- a/composer.lock
+++ b/composer.lock
@@ -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",
@@ -98,27 +98,27 @@
},
{
"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": [
@@ -152,7 +152,7 @@
],
"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": [
{
@@ -160,7 +160,7 @@
"type": "github"
}
],
- "time": "2020-09-07T11:50:18+00:00"
+ "time": "2020-12-27T12:05:53+00:00"
},
{
"name": "barryvdh/laravel-snappy",
@@ -709,16 +709,16 @@
},
{
"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": {
@@ -726,11 +726,11 @@
"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": {
@@ -775,9 +775,9 @@
"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",
diff --git a/tests/Commands/ClearActivityCommandTest.php b/tests/Commands/ClearActivityCommandTest.php
index 60f75675d..751a165c6 100644
--- a/tests/Commands/ClearActivityCommandTest.php
+++ b/tests/Commands/ClearActivityCommandTest.php
@@ -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');
diff --git a/tests/Commands/ClearViewsCommandTest.php b/tests/Commands/ClearViewsCommandTest.php
index d553ead2e..04665adcf 100644
--- a/tests/Commands/ClearViewsCommandTest.php
+++ b/tests/Commands/ClearViewsCommandTest.php
@@ -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', [
diff --git a/tests/Commands/RegeneratePermissionsCommandTest.php b/tests/Commands/RegeneratePermissionsCommandTest.php
index 7965237ef..d5b34ba17 100644
--- a/tests/Commands/RegeneratePermissionsCommandTest.php
+++ b/tests/Commands/RegeneratePermissionsCommandTest.php
@@ -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]);
}