WordPress.org

Make WordPress Core

Ticket #40423: 40423.diff

File 40423.diff, 853 bytes (added by johnbillion, 4 years ago)
  • tests/phpunit/includes/testcase.php

    diff --git tests/phpunit/includes/testcase.php tests/phpunit/includes/testcase.php
    index c77511d3a4..83c6062e30 100644
    class WP_UnitTestCase extends PHPUnit_Framework_TestCase { 
    438438                $this->assertNotInstanceOf( 'WP_Error', $actual, $message );
    439439        }
    440440
     441        function assertIXRError( $actual, $message = '' ) {
     442                $this->assertInstanceOf( 'IXR_Error', $actual, $message );
     443        }
     444
     445        function assertNotIXRError( $actual, $message = '' ) {
     446                if ( $actual instanceof IXR_Error && '' === $message ) {
     447                        $message = $actual->message;
     448                }
     449                $this->assertNotInstanceOf( 'IXR_Error', $actual, $message );
     450        }
     451
    441452        function assertEqualFields( $object, $fields ) {
    442453                foreach( $fields as $field_name => $field_value ) {
    443454                        if ( $object->$field_name != $field_value ) {