Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
[lhc/web/wiklou.git] / tests / phpunit / includes / api / ApiBaseTest.php
index cce99ce..b1f4e0c 100644 (file)
@@ -272,8 +272,7 @@ class ApiBaseTest extends ApiTestCase {
                        $input !== null ? [ 'myParam' => $input ] : [] ) );
                $wrapper->mMainModule = new ApiMain( $context );
 
-               $parseLimits = isset( $options['parseLimits'] ) ?
-                       $options['parseLimits'] : true;
+               $parseLimits = $options['parseLimits'] ?? true;
 
                if ( !empty( $options['apihighlimits'] ) ) {
                        $context->setUser( self::$users['sysop']->getUser() );
@@ -1221,7 +1220,7 @@ class ApiBaseTest extends ApiTestCase {
                ];
 
                foreach ( $integerTests as $test ) {
-                       $desc = isset( $test[2] ) ? $test[2] : $test[0];
+                       $desc = $test[2] ?? $test[0];
                        $warnings = isset( $test[3] ) ?
                                [ [ 'apiwarn-badutf8', 'myParam' ] ] : [];
                        $returnArray["\"$desc\" as integer"] = [