@@ -2005,11 +2005,19 @@ function run_test(string $php, $file, array $env): string
20052005 $ ini_settings = $ workerID ? ['opcache.cache_id ' => "worker $ workerID " ] : [];
20062006
20072007 // Additional required extensions
2008+ $ extensions = [];
20082009 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 != []) {
20092018 $ ext_params = [];
20102019 settings2array ($ ini_overwrites , $ ext_params );
20112020 $ ext_params = settings2params ($ ext_params );
2012- $ extensions = preg_split ("/[ \n\r]+/ " , trim ($ test ->getSection ('EXTENSIONS ' )));
20132021 [$ ext_dir , $ loaded ] = $ skipCache ->getExtensions ("$ orig_php $ pass_options $ extra_options $ ext_params $ no_file_cache " );
20142022 $ ext_prefix = IS_WINDOWS ? "php_ " : "" ;
20152023 $ missing = [];
@@ -2161,6 +2169,7 @@ function run_test(string $php, $file, array $env): string
21612169 $ IN_REDIRECT ['via ' ] = "via [ $ shortname] \n\t" ;
21622170 $ IN_REDIRECT ['dir ' ] = realpath (dirname ($ file ));
21632171 $ IN_REDIRECT ['prefix ' ] = $ tested ;
2172+ $ IN_REDIRECT ['EXTENSIONS ' ] = $ extensions ;
21642173
21652174 if (!empty ($ IN_REDIRECT ['TESTS ' ])) {
21662175 if (is_array ($ org_file )) {
@@ -3322,6 +3331,9 @@ class JUnit
33223331 'execution_time ' => 0 ,
33233332 ];
33243333
3334+ /**
3335+ * @throws Exception
3336+ */
33253337 public function __construct (array $ env , int $ workerID )
33263338 {
33273339 // Check whether a junit log is wanted.
@@ -3539,6 +3551,9 @@ public function initSuite(string $suite_name): void
35393551 $ this ->suites [$ suite_name ] = self ::EMPTY_SUITE + ['name ' => $ suite_name ];
35403552 }
35413553
3554+ /**
3555+ * @throws Exception
3556+ */
35423557 public function stopTimer (string $ file_name ): void
35433558 {
35443559 if (!$ this ->enabled ) {
@@ -3738,6 +3753,9 @@ class TestFile
37383753 'CREDITS ' , 'DESCRIPTION ' , 'CONFLICTS ' , 'WHITESPACE_SENSITIVE ' ,
37393754 ];
37403755
3756+ /**
3757+ * @throws BorkageException
3758+ */
37413759 public function __construct (string $ fileName , bool $ inRedirect )
37423760 {
37433761 $ this ->fileName = $ fileName ;
@@ -3778,6 +3796,9 @@ public function sectionNotEmpty(string $name): bool
37783796 return !empty ($ this ->sections [$ name ]);
37793797 }
37803798
3799+ /**
3800+ * @throws Exception
3801+ */
37813802 public function getSection (string $ name ): string
37823803 {
37833804 if (!isset ($ this ->sections [$ name ])) {
@@ -3814,6 +3835,7 @@ public function setSection(string $name, string $value): void
38143835
38153836 /**
38163837 * Load the sections of the test file
3838+ * @throws BorkageException
38173839 */
38183840 private function readFile (): void
38193841 {
@@ -3876,6 +3898,9 @@ private function readFile(): void
38763898 fclose ($ fp );
38773899 }
38783900
3901+ /**
3902+ * @throws BorkageException
3903+ */
38793904 private function validateAndProcess (bool $ inRedirect ): void
38803905 {
38813906 // the redirect section allows a set of tests to be reused outside of
0 commit comments