Make WordPress Core


Ignore:
Timestamp:
09/22/2026 11:04:55 PM (8 weeks ago)
Author:
lancewillett
Message:

Tests: Use strict assertions in additional test cases.

Replace loose equality and inequality assertions in selected core tests with strict comparisons where the fixtures and surrounding assertions establish the expected types.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/12583

Props soean, mukesh27, desrosj.
See #64895.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-users-controller.php

    r63160 r63880  
    19961996
    19971997                $this->assertSame( 'editor', $new_data['roles'][0] );
    1998                 $this->assertNotEquals( 'administrator', $new_data['roles'][0] );
     1998                $this->assertNotSame( 'administrator', $new_data['roles'][0] );
    19991999
    20002000                $user = get_userdata( $user_id );
    … …  
    20912091                $new_data = $response->get_data();
    20922092                $this->assertSame( 'editor', $new_data['roles'][0] );
    2093                 $this->assertNotEquals( 'administrator', $new_data['roles'][0] );
     2093                $this->assertNotSame( 'administrator', $new_data['roles'][0] );
    20942094
    20952095                $user_id = self::factory()->user->create( array( 'role' => 'administrator' ) );
    … …  
    21052105                $new_data = $response->get_data();
    21062106                $this->assertSame( 'editor', $new_data['roles'][0] );
    2107                 $this->assertNotEquals( 'administrator', $new_data['roles'][0] );
     2107                $this->assertNotSame( 'administrator', $new_data['roles'][0] );
    21082108        }
    21092109
Note: See TracChangeset for help on using the changeset viewer.