Skip to content

Use EXTENSIONS instead of SKIPIF sections in *.phpt #13276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

petk
Copy link
Member

@petk petk commented Jan 30, 2024

This changes the SKIPIF to EXTENSIONS in *.phpt.

There are some typos (PDO instead of pdo and zend-test instead of zend_test):

  • ext/dom/tests/libxml_global_state_entity_loader_bypass.phpt
  • ext/simplexml/tests/libxml_global_state_entity_loader_bypass.phpt
  • ext/xmlreader/tests/libxml_global_state_entity_loader_bypass.phpt
  • ext/zend_test/tests/observer_sqlite_create_function.phpt

Should PHP-8.2 branch be updated for these?

Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Should PHP-8.2 branch be updated for these?

Yeah, I think that's for the better. Although fixes are merged upwards, it's still possible something specific in an older branch breaks while not breaking in a newer branch, so it makes sense to update 8.2+ too.

Copy link
Member

@devnexen devnexen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@alexdowad
Copy link
Contributor

I like it, thanks for this.

Copy link
Member

@bukka bukka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Technically this is not a fix unless I'm missing something? Still I'm fine if you wish to target 8.2 as I merge non fixes for tests to reduce potentially conflicts (especially in FPM). Although not sure if it's the case here so might be fine to also target master only...

@petk
Copy link
Member Author

petk commented Jan 30, 2024

These 4 tests are skipped if wrong name is used. Interesting is that name "PDO" works on PHP-8.2 but on PHP-8.3+ it is skipped (case sensitive and something was probably changed in run-tests.php along the way).

I was thinking of adding only these to PHP-8.2+:

diff --git a/ext/dom/tests/libxml_global_state_entity_loader_bypass.phpt b/ext/dom/tests/libxml_global_state_entity_loader_bypass.phpt
index 7fc2a249ac..e47e5d088e 100644
--- a/ext/dom/tests/libxml_global_state_entity_loader_bypass.phpt
+++ b/ext/dom/tests/libxml_global_state_entity_loader_bypass.phpt
@@ -1,10 +1,11 @@
 --TEST--
 GHSA-3qrf-m4j2-pcrr (libxml global state entity loader bypass)
+--EXTENSIONS--
+libxml
+dom
+zend_test
 --SKIPIF--
 <?php
-if (!extension_loaded('libxml')) die('skip libxml extension not available');
-if (!extension_loaded('dom')) die('skip dom extension not available');
-if (!extension_loaded('zend-test')) die('skip zend-test extension not available');
 if (!function_exists('zend_test_override_libxml_global_state')) die('skip not for Windows');
 ?>
 --FILE--
diff --git a/ext/simplexml/tests/libxml_global_state_entity_loader_bypass.phpt b/ext/simplexml/tests/libxml_global_state_entity_loader_bypass.phpt
index 54f9d4941e..ae5a29913e 100644
--- a/ext/simplexml/tests/libxml_global_state_entity_loader_bypass.phpt
+++ b/ext/simplexml/tests/libxml_global_state_entity_loader_bypass.phpt
@@ -1,10 +1,11 @@
 --TEST--
 GHSA-3qrf-m4j2-pcrr (libxml global state entity loader bypass)
+--EXTENSIONS--
+libxml
+simplexml
+zend_test
 --SKIPIF--
 <?php
-if (!extension_loaded('libxml')) die('skip libxml extension not available');
-if (!extension_loaded('simplexml')) die('skip simplexml extension not available');
-if (!extension_loaded('zend-test')) die('skip zend-test extension not available');
 if (!function_exists('zend_test_override_libxml_global_state')) die('skip not for Windows');
 ?>
 --FILE--
diff --git a/ext/xmlreader/tests/libxml_global_state_entity_loader_bypass.phpt b/ext/xmlreader/tests/libxml_global_state_entity_loader_bypass.phpt
index cb0297b6b1..a0223367c7 100644
--- a/ext/xmlreader/tests/libxml_global_state_entity_loader_bypass.phpt
+++ b/ext/xmlreader/tests/libxml_global_state_entity_loader_bypass.phpt
@@ -1,10 +1,11 @@
 --TEST--
 GHSA-3qrf-m4j2-pcrr (libxml global state entity loader bypass)
+--EXTENSIONS--
+libxml
+xmlreader
+zend_test
 --SKIPIF--
 <?php
-if (!extension_loaded('libxml')) die('skip libxml extension not available');
-if (!extension_loaded('xmlreader')) die('skip xmlreader extension not available');
-if (!extension_loaded('zend-test')) die('skip zend-test extension not available');
 if (!function_exists('zend_test_override_libxml_global_state')) die('skip not for Windows');
 ?>
 --FILE--
diff --git a/ext/zend_test/tests/observer_sqlite_create_function.phpt b/ext/zend_test/tests/observer_sqlite_create_function.phpt
index 85d269c9ea..26330043ef 100644
--- a/ext/zend_test/tests/observer_sqlite_create_function.phpt
+++ b/ext/zend_test/tests/observer_sqlite_create_function.phpt
@@ -2,7 +2,7 @@
 Observer: PDO::sqliteCreateFunction() can be observed
 --EXTENSIONS--
 zend_test
-PDO
+pdo
 pdo_sqlite
 --INI--
 zend_test.observer.enabled=1

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please merge into 8.2 and upwards. As the EXTENSIONS section is used for the Windows build to load the non-static extensions.

@petk petk closed this in 218a93b Jan 31, 2024
@petk
Copy link
Member Author

petk commented Jan 31, 2024

Ok, then I've added this to PHP-8.2+. Thanks all.

@petk petk deleted the patch-tests-skip branch January 31, 2024 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants