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/comment.php

    r50375 r51367  
    12661266
    12671267        // Number of exported comments.
    1268         $this->assertSame( 1, count( $actual['data'] ) );
     1268        $this->assertCount( 1, $actual['data'] );
    12691269
    12701270        // Number of exported comment properties.
    1271         $this->assertSame( 8, count( $actual['data'][0]['data'] ) );
     1271        $this->assertCount( 8, $actual['data'][0]['data'] );
    12721272
    12731273        // Exported group.
     
    13291329
    13301330        // Number of exported comments.
    1331         $this->assertSame( 1, count( $actual['data'] ) );
     1331        $this->assertCount( 1, $actual['data'] );
    13321332
    13331333        // Number of exported comment properties.
    1334         $this->assertSame( 7, count( $actual['data'][0]['data'] ) );
     1334        $this->assertCount( 7, $actual['data'][0]['data'] );
    13351335    }
    13361336
     
    13601360
    13611361        // Number of exported comments.
    1362         $this->assertSame( 0, count( $actual['data'] ) );
     1362        $this->assertCount( 0, $actual['data'] );
    13631363    }
    13641364}
Note: See TracChangeset for help on using the changeset viewer.