Make WordPress Core


Ignore:
Timestamp:
11/25/2021 07:39:31 PM (3 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Correct the order and naming of expected and actual values in various tests.

This corrects the order of the parameters when used in assertions so if/when they fail the failure message is correct.

See #53363

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/meta/registerMeta.php

    r49603 r52248  
    180180            ),
    181181        );
    182         $this->assertSame( $actual, $expected );
     182        $this->assertSame( $expected, $actual );
    183183    }
    184184
     
    522522        $object_id            = self::$$object_property_name;
    523523        $default_value        = get_metadata_default( $object_type, $object_id, $meta_key, $single );
    524         $this->assertSame( $default_value, $expected );
     524        $this->assertSame( $expected, $default_value );
    525525
    526526        // Check for default value.
    527527        $value = get_metadata( $object_type, $object_id, $meta_key, $single );
    528         $this->assertSame( $value, $expected );
     528        $this->assertSame( $expected, $value );
    529529
    530530        // Set value to check default is not being returned by mistake.
     
    537537        delete_metadata( $object_type, $object_id, $meta_key );
    538538        $value = get_metadata( $object_type, $object_id, $meta_key, $single );
    539         $this->assertSame( $value, $expected );
     539        $this->assertSame( $expected, $value );
    540540
    541541        // Set other meta key, to make sure other keys are not effects.
     
    569569        $object_id            = self::$$object_property_name;
    570570        $default_value        = get_metadata_default( $object_type, $object_id, $meta_key, $single );
    571         $this->assertSame( $default_value, $expected );
     571        $this->assertSame( $expected, $default_value );
    572572    }
    573573
Note: See TracChangeset for help on using the changeset viewer.