WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/07/2021 10:32:56 AM (3 months ago)
Author:
SergeyBiryukov
Message:

Tests: Use more appropriate assertions in various tests.

This replaces instances of assertSame( [number], count( ... ) ) with assertCount() to use native PHPUnit functionality.

Follow-up to [51335], [51337].

See #53363.

File:
1 edited

Legend:

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

    r50450 r51367  
    212212        $this->assertArrayHasKey( 1, $types );
    213213        $this->assertSame( 'attachment', $types[1] );
    214         $this->assertSame( 2, count( $types ) );
     214        $this->assertCount( 2, $types );
    215215    }
    216216
     
    220220        $data       = $response->get_data();
    221221        $properties = $data['schema']['properties'];
    222         $this->assertSame( 10, count( $properties ) );
     222        $this->assertCount( 10, $properties );
    223223        $this->assertArrayHasKey( 'capabilities', $properties );
    224224        $this->assertArrayHasKey( 'description', $properties );
Note: See TracChangeset for help on using the changeset viewer.