@@ -2093,11 +2093,19 @@ function run_test(string $php, $file, array $env): string
2093
2093
$ ini_settings = $ workerID ? ['opcache.cache_id ' => "worker $ workerID " ] : [];
2094
2094
2095
2095
// Additional required extensions
2096
+ $ extensions = [];
2096
2097
if ($ test ->hasSection ('EXTENSIONS ' )) {
2098
+ $ extensions = preg_split ("/[ \n\r]+/ " , trim ($ test ->getSection ('EXTENSIONS ' )));
2099
+ }
2100
+ if (is_array ($ IN_REDIRECT ) && $ IN_REDIRECT ['EXTENSIONS ' ] != []) {
2101
+ $ extensions = array_merge ($ extensions , $ IN_REDIRECT ['EXTENSIONS ' ]);
2102
+ }
2103
+
2104
+ /* Load required extensions */
2105
+ if ($ extensions != []) {
2097
2106
$ ext_params = [];
2098
2107
settings2array ($ ini_overwrites , $ ext_params );
2099
2108
$ ext_params = settings2params ($ ext_params );
2100
- $ extensions = preg_split ("/[ \n\r]+/ " , trim ($ test ->getSection ('EXTENSIONS ' )));
2101
2109
[$ ext_dir , $ loaded ] = $ skipCache ->getExtensions ("$ orig_php $ pass_options $ extra_options $ ext_params $ no_file_cache " );
2102
2110
$ ext_prefix = IS_WINDOWS ? "php_ " : "" ;
2103
2111
$ missing = [];
@@ -2249,6 +2257,7 @@ function run_test(string $php, $file, array $env): string
2249
2257
$ IN_REDIRECT ['via ' ] = "via [ $ shortname] \n\t" ;
2250
2258
$ IN_REDIRECT ['dir ' ] = realpath (dirname ($ file ));
2251
2259
$ IN_REDIRECT ['prefix ' ] = $ tested ;
2260
+ $ IN_REDIRECT ['EXTENSIONS ' ] = $ extensions ;
2252
2261
2253
2262
if (!empty ($ IN_REDIRECT ['TESTS ' ])) {
2254
2263
if (is_array ($ org_file )) {
@@ -3403,6 +3412,9 @@ class JUnit
3403
3412
'execution_time ' => 0 ,
3404
3413
];
3405
3414
3415
+ /**
3416
+ * @throws Exception
3417
+ */
3406
3418
public function __construct (array $ env , int $ workerID )
3407
3419
{
3408
3420
// Check whether a junit log is wanted.
@@ -3620,6 +3632,9 @@ public function initSuite(string $suite_name): void
3620
3632
$ this ->suites [$ suite_name ] = self ::EMPTY_SUITE + ['name ' => $ suite_name ];
3621
3633
}
3622
3634
3635
+ /**
3636
+ * @throws Exception
3637
+ */
3623
3638
public function stopTimer (string $ file_name ): void
3624
3639
{
3625
3640
if (!$ this ->enabled ) {
@@ -3819,6 +3834,9 @@ class TestFile
3819
3834
'CREDITS ' , 'DESCRIPTION ' , 'CONFLICTS ' , 'WHITESPACE_SENSITIVE ' ,
3820
3835
];
3821
3836
3837
+ /**
3838
+ * @throws BorkageException
3839
+ */
3822
3840
public function __construct (string $ fileName , bool $ inRedirect )
3823
3841
{
3824
3842
$ this ->fileName = $ fileName ;
@@ -3859,6 +3877,9 @@ public function sectionNotEmpty(string $name): bool
3859
3877
return !empty ($ this ->sections [$ name ]);
3860
3878
}
3861
3879
3880
+ /**
3881
+ * @throws Exception
3882
+ */
3862
3883
public function getSection (string $ name ): string
3863
3884
{
3864
3885
if (!isset ($ this ->sections [$ name ])) {
@@ -3895,6 +3916,7 @@ public function setSection(string $name, string $value): void
3895
3916
3896
3917
/**
3897
3918
* Load the sections of the test file
3919
+ * @throws BorkageException
3898
3920
*/
3899
3921
private function readFile (): void
3900
3922
{
@@ -3957,6 +3979,9 @@ private function readFile(): void
3957
3979
fclose ($ fp );
3958
3980
}
3959
3981
3982
+ /**
3983
+ * @throws BorkageException
3984
+ */
3960
3985
private function validateAndProcess (bool $ inRedirect ): void
3961
3986
{
3962
3987
// the redirect section allows a set of tests to be reused outside of
0 commit comments