@@ -2005,11 +2005,19 @@ function run_test(string $php, $file, array $env): string
2005
2005
$ ini_settings = $ workerID ? ['opcache.cache_id ' => "worker $ workerID " ] : [];
2006
2006
2007
2007
// Additional required extensions
2008
+ $ extensions = [];
2008
2009
if ($ test ->hasSection ('EXTENSIONS ' )) {
2010
+ $ extensions = preg_split ("/[ \n\r]+/ " , trim ($ test ->getSection ('EXTENSIONS ' )));
2011
+ }
2012
+ if (is_array ($ IN_REDIRECT ) && $ IN_REDIRECT ['EXTENSIONS ' ] != []) {
2013
+ $ extensions = array_merge ($ extensions , $ IN_REDIRECT ['EXTENSIONS ' ]);
2014
+ }
2015
+
2016
+ /* Load required extensions */
2017
+ if ($ extensions != []) {
2009
2018
$ ext_params = [];
2010
2019
settings2array ($ ini_overwrites , $ ext_params );
2011
2020
$ ext_params = settings2params ($ ext_params );
2012
- $ extensions = preg_split ("/[ \n\r]+/ " , trim ($ test ->getSection ('EXTENSIONS ' )));
2013
2021
[$ ext_dir , $ loaded ] = $ skipCache ->getExtensions ("$ orig_php $ pass_options $ extra_options $ ext_params $ no_file_cache " );
2014
2022
$ ext_prefix = IS_WINDOWS ? "php_ " : "" ;
2015
2023
$ missing = [];
@@ -2161,6 +2169,7 @@ function run_test(string $php, $file, array $env): string
2161
2169
$ IN_REDIRECT ['via ' ] = "via [ $ shortname] \n\t" ;
2162
2170
$ IN_REDIRECT ['dir ' ] = realpath (dirname ($ file ));
2163
2171
$ IN_REDIRECT ['prefix ' ] = $ tested ;
2172
+ $ IN_REDIRECT ['EXTENSIONS ' ] = $ extensions ;
2164
2173
2165
2174
if (!empty ($ IN_REDIRECT ['TESTS ' ])) {
2166
2175
if (is_array ($ org_file )) {
@@ -3322,6 +3331,9 @@ class JUnit
3322
3331
'execution_time ' => 0 ,
3323
3332
];
3324
3333
3334
+ /**
3335
+ * @throws Exception
3336
+ */
3325
3337
public function __construct (array $ env , int $ workerID )
3326
3338
{
3327
3339
// Check whether a junit log is wanted.
@@ -3539,6 +3551,9 @@ public function initSuite(string $suite_name): void
3539
3551
$ this ->suites [$ suite_name ] = self ::EMPTY_SUITE + ['name ' => $ suite_name ];
3540
3552
}
3541
3553
3554
+ /**
3555
+ * @throws Exception
3556
+ */
3542
3557
public function stopTimer (string $ file_name ): void
3543
3558
{
3544
3559
if (!$ this ->enabled ) {
@@ -3738,6 +3753,9 @@ class TestFile
3738
3753
'CREDITS ' , 'DESCRIPTION ' , 'CONFLICTS ' , 'WHITESPACE_SENSITIVE ' ,
3739
3754
];
3740
3755
3756
+ /**
3757
+ * @throws BorkageException
3758
+ */
3741
3759
public function __construct (string $ fileName , bool $ inRedirect )
3742
3760
{
3743
3761
$ this ->fileName = $ fileName ;
@@ -3778,6 +3796,9 @@ public function sectionNotEmpty(string $name): bool
3778
3796
return !empty ($ this ->sections [$ name ]);
3779
3797
}
3780
3798
3799
+ /**
3800
+ * @throws Exception
3801
+ */
3781
3802
public function getSection (string $ name ): string
3782
3803
{
3783
3804
if (!isset ($ this ->sections [$ name ])) {
@@ -3814,6 +3835,7 @@ public function setSection(string $name, string $value): void
3814
3835
3815
3836
/**
3816
3837
* Load the sections of the test file
3838
+ * @throws BorkageException
3817
3839
*/
3818
3840
private function readFile (): void
3819
3841
{
@@ -3876,6 +3898,9 @@ private function readFile(): void
3876
3898
fclose ($ fp );
3877
3899
}
3878
3900
3901
+ /**
3902
+ * @throws BorkageException
3903
+ */
3879
3904
private function validateAndProcess (bool $ inRedirect ): void
3880
3905
{
3881
3906
// the redirect section allows a set of tests to be reused outside of
0 commit comments