Skip to content

Commit 8286a57

Browse files
committed
Patch ext/zip tests
1 parent f1f866c commit 8286a57

File tree

3 files changed

+136
-8
lines changed

3 files changed

+136
-8
lines changed

patches/8.3/tests.patch

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
From: Peter Kokot <[email protected]>
2+
Subject: Fix tests
3+
4+
- ext/zip
5+
When PHP is compiled and built agains libzip that doesn't have AES
6+
support enabled (if all encryption options are set to OFF in CMake),
7+
ZipArchive::EM_AES_256 and ZipArchive::EM_AES_192 aren't supported.
8+
---
9+
ext/zip/tests/oo_addglob2.phpt | 6 ++++++
10+
ext/zip/tests/oo_encryption.phpt | 6 ++++++
11+
2 files changed, 12 insertions(+)
12+
13+
diff --git a/ext/zip/tests/oo_addglob2.phpt b/ext/zip/tests/oo_addglob2.phpt
14+
index 517c0b7fd7f..1432d704de5 100644
15+
--- a/ext/zip/tests/oo_addglob2.phpt
16+
+++ b/ext/zip/tests/oo_addglob2.phpt
17+
@@ -6,6 +6,12 @@
18+
<?php
19+
if (!method_exists('ZipArchive', 'setEncryptionName')) die('skip encrytion not supported');
20+
if(!defined("GLOB_BRACE")) die ('skip requires GLOB_BRACE');
21+
+if (
22+
+ method_exists('ZipArchive', 'isEncryptionMethodSupported')
23+
+ && !ZipArchive::isEncryptionMethodSupported(ZipArchive::EM_AES_256)
24+
+) {
25+
+ die('skip EM_AES_256 encryption not supported');
26+
+}
27+
?>
28+
--FILE--
29+
<?php
30+
diff --git a/ext/zip/tests/oo_encryption.phpt b/ext/zip/tests/oo_encryption.phpt
31+
index f5207e30759..ccc0a04b8f1 100644
32+
--- a/ext/zip/tests/oo_encryption.phpt
33+
+++ b/ext/zip/tests/oo_encryption.phpt
34+
@@ -5,6 +5,12 @@
35+
--SKIPIF--
36+
<?php
37+
if (!method_exists('ZipArchive', 'setEncryptionName')) die('skip encryption not supported');
38+
+if (
39+
+ method_exists('ZipArchive', 'isEncryptionMethodSupported')
40+
+ && !ZipArchive::isEncryptionMethodSupported(ZipArchive::EM_AES_256)
41+
+) {
42+
+ die('skip EM_AES_256 encryption not supported');
43+
+}
44+
?>
45+
--FILE--
46+
<?php

patches/8.4/tests.patch

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,18 @@ From: Peter Kokot <[email protected]>
22
Subject: Fix tests
33

44
- ext/dom
5-
- When running tests from a directory located inside php-src, for
6-
example, php-src/php-build relative paths need to be adjusted.
5+
When running tests from a directory located inside php-src, for
6+
example, php-src/php-build relative paths need to be adjusted.
7+
8+
- ext/zip
9+
When PHP is compiled and built agains libzip that doesn't have AES
10+
support enabled (if all encryption options are set to OFF in CMake),
11+
ZipArchive::EM_AES_256 and ZipArchive::EM_AES_192 aren't supported.
712
---
8-
ext/dom/tests/dom_xinclude.phpt | 4 ++--
9-
1 file changed, 2 insertions(+), 2 deletions(-)
13+
ext/dom/tests/dom_xinclude.phpt | 4 ++--
14+
ext/zip/tests/oo_addglob2.phpt | 6 ++++++
15+
ext/zip/tests/oo_encryption.phpt | 6 ++++++
16+
3 files changed, 14 insertions(+), 2 deletions(-)
1017

1118
diff --git a/ext/dom/tests/dom_xinclude.phpt b/ext/dom/tests/dom_xinclude.phpt
1219
index 0dfeb2dfb4a..410431de877 100644
@@ -25,3 +32,37 @@ index 0dfeb2dfb4a..410431de877 100644
2532
<title>The Pearl</title>
2633
<author>John Steinbeck</author>
2734
</book>
35+
diff --git a/ext/zip/tests/oo_addglob2.phpt b/ext/zip/tests/oo_addglob2.phpt
36+
index 517c0b7fd7f..1432d704de5 100644
37+
--- a/ext/zip/tests/oo_addglob2.phpt
38+
+++ b/ext/zip/tests/oo_addglob2.phpt
39+
@@ -6,6 +6,12 @@
40+
<?php
41+
if (!method_exists('ZipArchive', 'setEncryptionName')) die('skip encrytion not supported');
42+
if(!defined("GLOB_BRACE")) die ('skip requires GLOB_BRACE');
43+
+if (
44+
+ method_exists('ZipArchive', 'isEncryptionMethodSupported')
45+
+ && !ZipArchive::isEncryptionMethodSupported(ZipArchive::EM_AES_256)
46+
+) {
47+
+ die('skip EM_AES_256 encryption not supported');
48+
+}
49+
?>
50+
--FILE--
51+
<?php
52+
diff --git a/ext/zip/tests/oo_encryption.phpt b/ext/zip/tests/oo_encryption.phpt
53+
index f5207e30759..ccc0a04b8f1 100644
54+
--- a/ext/zip/tests/oo_encryption.phpt
55+
+++ b/ext/zip/tests/oo_encryption.phpt
56+
@@ -5,6 +5,12 @@
57+
--SKIPIF--
58+
<?php
59+
if (!method_exists('ZipArchive', 'setEncryptionName')) die('skip encryption not supported');
60+
+if (
61+
+ method_exists('ZipArchive', 'isEncryptionMethodSupported')
62+
+ && !ZipArchive::isEncryptionMethodSupported(ZipArchive::EM_AES_256)
63+
+) {
64+
+ die('skip EM_AES_256 encryption not supported');
65+
+}
66+
?>
67+
--FILE--
68+
<?php

patches/8.5/tests.patch

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,18 @@ From: Peter Kokot <[email protected]>
22
Subject: Fix tests
33

44
- ext/dom
5-
- When running tests from a directory located inside php-src, for
6-
example, php-src/php-build relative paths need to be adjusted.
5+
When running tests from a directory located inside php-src, for
6+
example, php-src/php-build relative paths need to be adjusted.
7+
8+
- ext/zip
9+
When PHP is compiled and built agains libzip that doesn't have AES
10+
support enabled (if all encryption options are set to OFF in CMake),
11+
ZipArchive::EM_AES_256 and ZipArchive::EM_AES_192 aren't supported.
712
---
8-
ext/dom/tests/dom_xinclude.phpt | 4 ++--
9-
1 file changed, 2 insertions(+), 2 deletions(-)
13+
ext/dom/tests/dom_xinclude.phpt | 4 ++--
14+
ext/zip/tests/oo_addglob2.phpt | 6 ++++++
15+
ext/zip/tests/oo_encryption.phpt | 6 ++++++
16+
3 files changed, 14 insertions(+), 2 deletions(-)
1017

1118
diff --git a/ext/dom/tests/dom_xinclude.phpt b/ext/dom/tests/dom_xinclude.phpt
1219
index 0dfeb2dfb4a..410431de877 100644
@@ -25,3 +32,37 @@ index 0dfeb2dfb4a..410431de877 100644
2532
<title>The Pearl</title>
2633
<author>John Steinbeck</author>
2734
</book>
35+
diff --git a/ext/zip/tests/oo_addglob2.phpt b/ext/zip/tests/oo_addglob2.phpt
36+
index 517c0b7fd7f..1432d704de5 100644
37+
--- a/ext/zip/tests/oo_addglob2.phpt
38+
+++ b/ext/zip/tests/oo_addglob2.phpt
39+
@@ -6,6 +6,12 @@
40+
<?php
41+
if (!method_exists('ZipArchive', 'setEncryptionName')) die('skip encrytion not supported');
42+
if(!defined("GLOB_BRACE")) die ('skip requires GLOB_BRACE');
43+
+if (
44+
+ method_exists('ZipArchive', 'isEncryptionMethodSupported')
45+
+ && !ZipArchive::isEncryptionMethodSupported(ZipArchive::EM_AES_256)
46+
+) {
47+
+ die('skip EM_AES_256 encryption not supported');
48+
+}
49+
?>
50+
--FILE--
51+
<?php
52+
diff --git a/ext/zip/tests/oo_encryption.phpt b/ext/zip/tests/oo_encryption.phpt
53+
index f5207e30759..ccc0a04b8f1 100644
54+
--- a/ext/zip/tests/oo_encryption.phpt
55+
+++ b/ext/zip/tests/oo_encryption.phpt
56+
@@ -5,6 +5,12 @@
57+
--SKIPIF--
58+
<?php
59+
if (!method_exists('ZipArchive', 'setEncryptionName')) die('skip encryption not supported');
60+
+if (
61+
+ method_exists('ZipArchive', 'isEncryptionMethodSupported')
62+
+ && !ZipArchive::isEncryptionMethodSupported(ZipArchive::EM_AES_256)
63+
+) {
64+
+ die('skip EM_AES_256 encryption not supported');
65+
+}
66+
?>
67+
--FILE--
68+
<?php

0 commit comments

Comments
 (0)