Do not run tests that depend on curl if it is not loaded
authorHuji Lee <huji.huji@gmail.com>
Tue, 19 Sep 2017 03:14:00 +0000 (23:14 -0400)
committerHuji Lee <huji.huji@gmail.com>
Wed, 20 Sep 2017 01:51:59 +0000 (21:51 -0400)
Bug: T176193
Change-Id: Ia7b9b0196f800eb14463acc2a24df5ac1e48f3ed

tests/phpunit/includes/http/HttpTest.php

index 3693a27..3790e3a 100644 (file)
@@ -497,6 +497,10 @@ class HttpTest extends MediaWikiTestCase {
         * @dataProvider provideCurlConstants
         */
        public function testCurlConstants( $value ) {
+               if ( !extension_loaded( 'curl' ) ) {
+                       $this->markTestSkipped( "PHP extension 'curl' is not loaded, skipping." );
+               }
+
                $this->assertTrue( defined( $value ), $value . ' not defined' );
        }
 }