tests: Use checkPHPExtension() instead of re-implementing it
authorKunal Mehta <legoktm@member.fsf.org>
Mon, 25 Dec 2017 03:13:51 +0000 (19:13 -0800)
committerBryanDavis <bdavis@wikimedia.org>
Mon, 25 Dec 2017 22:06:37 +0000 (22:06 +0000)
Change-Id: I7f5e8684d556befc0aefa302187c573e7a3cff62

tests/phpunit/includes/collation/CollationFaTest.php
tests/phpunit/includes/http/HttpTest.php

index 178a51c..f745541 100644 (file)
@@ -13,9 +13,7 @@ class CollationFaTest extends MediaWikiTestCase {
 
        public function setUp() {
                parent::setUp();
-               if ( !extension_loaded( 'intl' ) ) {
-                       $this->markTestSkipped( "PHP extension 'intl' is not loaded, skipping." );
-               }
+               $this->checkPHPExtension( 'intl' );
        }
 
        /**
index 3790e3a..2d73bac 100644 (file)
@@ -497,9 +497,7 @@ class HttpTest extends MediaWikiTestCase {
         * @dataProvider provideCurlConstants
         */
        public function testCurlConstants( $value ) {
-               if ( !extension_loaded( 'curl' ) ) {
-                       $this->markTestSkipped( "PHP extension 'curl' is not loaded, skipping." );
-               }
+               $this->checkPHPExtension( 'curl' );
 
                $this->assertTrue( defined( $value ), $value . ' not defined' );
        }