Make WordPress Core


Ignore:
Timestamp:
09/29/2023 03:22:12 PM (13 months ago)
Author:
jorbin
Message:

Tests: Reduce usage of assertEquals

Replaces assertSame with assertCount in a number of tests.

Props ayeshrajans, jorbin.
See #58956.

File:
1 edited

Legend:

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

    r56549 r56746  
    224224        );
    225225        $categories = get_terms( 'category', $args );
    226         $this->assertSame( count( $categories ), count( $data ) );
     226        $this->assertCount( count( $categories ), $data );
    227227    }
    228228
     
    256256        );
    257257        $categories = get_terms( 'category', $args );
    258         $this->assertSame( count( $categories ), count( $data ) );
     258        $this->assertCount( count( $categories ), $data );
    259259    }
    260260
     
    11901190        );
    11911191        $categories = get_terms( 'category', $args );
    1192         $this->assertSame( count( $categories ), count( $data ) );
     1192        $this->assertCount( count( $categories ), $data );
    11931193        $this->assertSame( $categories[0]->term_id, $data[0]['id'] );
    11941194        $this->assertSame( $categories[0]->name, $data[0]['name'] );
Note: See TracChangeset for help on using the changeset viewer.