Merge "clientpool: refactor Redis authentication error handling"
[lhc/web/wiklou.git] / tests / phpunit / includes / api / ApiMainTest.php
index 8ffe4fc..584c60c 100644 (file)
@@ -46,7 +46,7 @@ class ApiMainTest extends ApiTestCase {
         */
        private function getNonInternalApiMain( array $requestData, array $headers = [] ) {
                $req = $this->getMockBuilder( WebRequest::class )
-                       ->setMethods( [ 'response', 'getIP' ] )
+                       ->setMethods( [ 'response', 'getRawIP' ] )
                        ->getMock();
                $response = new FauxResponse();
                $req->method( 'response' )->willReturn( $response );
@@ -491,7 +491,7 @@ class ApiMainTest extends ApiTestCase {
                $module->expects( $this->any() )
                        ->method( 'getConditionalRequestData' )
                        ->will( $this->returnCallback( function ( $condition ) use ( $conditions ) {
-                               return isset( $conditions[$condition] ) ? $conditions[$condition] : null;
+                               return $conditions[$condition] ?? null;
                        } ) );
 
                $ret = $priv->checkConditionalRequestHeaders( $module );
@@ -622,7 +622,7 @@ class ApiMainTest extends ApiTestCase {
                $module->expects( $this->any() )
                        ->method( 'getConditionalRequestData' )
                        ->will( $this->returnCallback( function ( $condition ) use ( $conditions ) {
-                               return isset( $conditions[$condition] ) ? $conditions[$condition] : null;
+                               return $conditions[$condition] ?? null;
                        } ) );
                $priv->mModule = $module;
 
@@ -630,7 +630,7 @@ class ApiMainTest extends ApiTestCase {
 
                foreach ( [ 'Last-Modified', 'ETag' ] as $header ) {
                        $this->assertEquals(
-                               isset( $headers[$header] ) ? $headers[$header] : null,
+                               $headers[$header] ?? null,
                                $response->getHeader( $header ),
                                $header
                        );