*/
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 );
$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 );
$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;
foreach ( [ 'Last-Modified', 'ETag' ] as $header ) {
$this->assertEquals(
- isset( $headers[$header] ) ? $headers[$header] : null,
+ $headers[$header] ?? null,
$response->getHeader( $header ),
$header
);