File tree 2 files changed +37
-2
lines changed
2 files changed +37
-2
lines changed Original file line number Diff line number Diff line change @@ -727,13 +727,21 @@ public function __construct()
727
727
$ this ->variants ['xml ' ] = function (Build $ build ) {
728
728
$ options = array (
729
729
'--enable-dom ' ,
730
- '--enable-libxml ' ,
730
+ );
731
+
732
+ if ($ build ->compareVersion ('7.4 ' ) < 0 ) {
733
+ $ options [] = '--enable-libxml ' ;
734
+ } else {
735
+ $ options [] = '--with-libxml ' ;
736
+ }
737
+
738
+ $ options = array_merge ($ options , array (
731
739
'--enable-simplexml ' ,
732
740
'--enable-xml ' ,
733
741
'--enable-xmlreader ' ,
734
742
'--enable-xmlwriter ' ,
735
743
'--with-xsl ' ,
736
- );
744
+ )) ;
737
745
738
746
do {
739
747
if ($ bin = Utils::findBin ('brew ' )) {
Original file line number Diff line number Diff line change @@ -164,4 +164,31 @@ public function testNeutralVirtualVariant()
164
164
});
165
165
$ this ->assertEquals (array (), $ actual );
166
166
}
167
+
168
+ /**
169
+ * @param string $version
170
+ * @param string $expected
171
+ *
172
+ * @dataProvider libXmlProvider
173
+ */
174
+ public function testLibXml ($ version , $ expected )
175
+ {
176
+ $ build = new Build ($ version );
177
+ $ build ->enableVariant ('xml ' );
178
+
179
+ $ builder = new VariantBuilder ();
180
+ $ options = $ builder ->build ($ build );
181
+
182
+ $ this ->assertContains ($ expected , $ options );
183
+ }
184
+
185
+ public static function libXmlProvider ()
186
+ {
187
+ return array (
188
+ array ('7.3.0 ' , '--enable-libxml ' ),
189
+
190
+ // see https://github.com/php/php-src/pull/4037
191
+ array ('7.4.0-dev ' , '--with-libxml ' ),
192
+ );
193
+ }
167
194
}
You can’t perform that action at this time.
0 commit comments