Make WordPress Core


Ignore:
Timestamp:
09/29/2023 03:22:12 PM (3 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/rest-taxonomies-controller.php

    r56547 r56746  
    5151                $data       = $response->get_data();
    5252                $taxonomies = $this->get_public_taxonomies( get_taxonomies( '', 'objects' ) );
    53                 $this->assertSame( count( $taxonomies ), count( $data ) );
     53                $this->assertCount( count( $taxonomies ), $data );
    5454                $this->assertSame( 'Categories', $data['category']['name'] );
    5555                $this->assertSame( 'category', $data['category']['slug'] );
    … …  
    7070                unset( $taxonomies['nav_menu'] ); // Menus are not editable by contributors.
    7171                $taxonomies = $this->get_public_taxonomies( $taxonomies );
    72                 $this->assertSame( count( $taxonomies ), count( $data ) );
     72                $this->assertCount( count( $taxonomies ), $data );
    7373                $this->assertSame( 'Categories', $data['category']['name'] );
    7474                $this->assertSame( 'category', $data['category']['slug'] );
    … …  
    287287                $data       = $response->get_data();
    288288                $taxonomies = $this->get_public_taxonomies( get_object_taxonomies( $type, 'objects' ) );
    289                 $this->assertSame( count( $taxonomies ), count( $data ) );
     289                $this->assertCount( count( $taxonomies ), $data );
    290290        }
    291291
Note: See TracChangeset for help on using the changeset viewer.