Make WordPress Core


Ignore:
Timestamp:
09/29/2023 03:22:12 PM (2 years 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/wpRestMenusController.php

    r55457 r56746  
    339339        $data       = $response->get_data();
    340340        $properties = $data['schema']['properties'];
    341         $this->assertSame( 7, count( $properties ) );
     341        $this->assertCount( 7, $properties );
    342342        $this->assertArrayHasKey( 'id', $properties );
    343343        $this->assertArrayHasKey( 'description', $properties );
     
    574574        );
    575575        $tags = get_terms( self::TAXONOMY, $args );
    576         $this->assertSame( count( $tags ), count( $data ) );
     576        $this->assertCount( count( $tags ), $data );
    577577        $this->assertSame( $tags[0]->term_id, $data[0]['id'] );
    578578        $this->assertSame( $tags[0]->name, $data[0]['name'] );
Note: See TracChangeset for help on using the changeset viewer.