From 2ed10d49ba27f2d947e4bfd6a25943d286a12799 Mon Sep 17 00:00:00 2001 From: ADmad Date: Thu, 24 Dec 2020 11:16:42 +0530 Subject: [PATCH] PHP 8 version of Mpdf is not available yet --- .github/workflows/ci.yml | 3 +++ composer.json | 2 +- tests/TestCase/Pdf/Engine/MpdfEngineTest.php | 9 +++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 788de132..87a943ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,9 @@ jobs: run: | if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then composer update --prefer-lowest --prefer-stable + elif [[ ${{ matrix.php-version }} == '8.0' ]]; then + composer remove --dev mpdf/mpdf + composer install else composer install fi diff --git a/composer.json b/composer.json index 596e3326..c56310cd 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "cakephp/cakephp": "^4.0" }, "require-dev": { - "phpunit/phpunit": "~8.5.0", + "phpunit/phpunit": "~8.5.0 || ^9.3", "dompdf/dompdf": "^0.8.6", "mpdf/mpdf": "^8.0.4", "tecnickcom/tcpdf": "^6.3" diff --git a/tests/TestCase/Pdf/Engine/MpdfEngineTest.php b/tests/TestCase/Pdf/Engine/MpdfEngineTest.php index d2537ca4..4e697a54 100644 --- a/tests/TestCase/Pdf/Engine/MpdfEngineTest.php +++ b/tests/TestCase/Pdf/Engine/MpdfEngineTest.php @@ -13,6 +13,15 @@ */ class MpdfEngineTest extends TestCase { + public function setUp(): void + { + parent::setUp(); + + if (!class_exists(Mpdf::class)) { + $this->markTestSkipped('Mpdf is not loaded'); + } + } + /** * Tests that the engine sets the options properly. */