Make WordPress Core


Ignore:
Timestamp:
05/06/2024 06:39:15 PM (8 months ago)
Author:
johnbillion
Message:

Build/Test Tools: Standardise the assertions for remote HTTP request tests.

This ensures that as much information as possible is shown when an HTTP request fails during an external HTTP test.

Fixes #61148

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/http/base.php

    r56548 r58108  
    220220
    221221        $this->skipTestOnTimeout( $res );
     222        $this->assertNotWPError( $res );
    222223        $this->assertSame( 'PASS', wp_remote_retrieve_body( $res ) );
    223224        $this->assertNotEmpty( $res['headers']['location'] );
     
    357358
    358359        $this->skipTestOnTimeout( $res );
     360        $this->assertNotWPError( $res );
    359361        $this->assertSame( $method, wp_remote_retrieve_body( $res ) );
    360362    }
     
    407409
    408410        $this->skipTestOnTimeout( $res );
     411        $this->assertNotWPError( $res );
    409412        $this->assertSame( 'PASS', wp_remote_retrieve_body( $res ) );
    410413    }
     
    448451
    449452        $this->skipTestOnTimeout( $res );
     453        $this->assertNotWPError( $res );
    450454        $this->assertSame( 'PASS', wp_remote_retrieve_body( $res ) );
    451455    }
Note: See TracChangeset for help on using the changeset viewer.