File: 0006-Skip-OutputTest-when-Ghostscript-has-a-cache-error.patch

package info (click to toggle)
php-dompdf 3.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 5,848 kB
  • sloc: php: 26,450; sh: 109; xml: 100; makefile: 42
file content (41 lines) | stat: -rw-r--r-- 1,621 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From: William Desportes <williamdes@wdes.fr>
Date: Sat, 3 Aug 2024 20:39:48 +0200
Subject: Skip OutputTest when Ghostscript has a cache error

Origin: vendor
Forwarded: not-needed
---
 tests/OutputTest/OutputTest.php | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/OutputTest/OutputTest.php b/tests/OutputTest/OutputTest.php
index 73df571..cc22d61 100644
--- a/tests/OutputTest/OutputTest.php
+++ b/tests/OutputTest/OutputTest.php
@@ -6,6 +6,7 @@ use Dompdf\Tests\TestCase;
 use FilesystemIterator;
 use Iterator;
 use PHPUnit\Framework\AssertionFailedError;
+use PHPUnit\Framework\IncompleteTestError;
 use RecursiveDirectoryIterator;
 use RecursiveIteratorIterator;
 use RuntimeException;
@@ -80,6 +81,8 @@ final class OutputTest extends TestCase
 
         try {
             $this->assertOutputMatches($referenceFile, $actualOutputFile);
+        } catch (IncompleteTestError $e) {
+            throw $e;
         } catch (AssertionFailedError $e) {
             $path = $this->saveFailedOutput($dataset);
             throw new AssertionFailedError(
@@ -113,6 +116,9 @@ final class OutputTest extends TestCase
             // STDERR. Since we only expect image data, consider any other
             // output a failure
             if ($error !== "") {
+                if (str_contains($error, "Fontconfig error: No writable cache directories")) {
+                    $this->markTestIncomplete('Ghostscript error: Fontconfig error: No writable cache directories');
+                }
                 throw new RuntimeException("Unexpected Ghostscript output: `$error`");
             }
         }