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

    r50449 r51367  
    1717        $excerpt = get_comment_excerpt( $comment_id );
    1818
    19         $this->assertSame( 20, count( explode( ' ', $excerpt ) ) );
     19        $this->assertCount( 20, explode( ' ', $excerpt ) );
    2020    }
    2121
     
    3131        $excerpt = get_comment_excerpt( $comment_id );
    3232
    33         $this->assertSame( 10, count( explode( ' ', $excerpt ) ) );
     33        $this->assertCount( 10, explode( ' ', $excerpt ) );
    3434    }
    3535
Note: See TracChangeset for help on using the changeset viewer.