Make WordPress Core


Ignore:
Timestamp:
07/07/2021 10:32:56 AM (3 years 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/term/getTheTerms.php

    r51335 r51367  
    2323        // Cache should be empty after a set.
    2424        $tt_1 = wp_set_object_terms( $post_id, $terms_1, $this->taxonomy );
    25         $this->assertSame( 3, count( $tt_1 ) );
     25        $this->assertCount( 3, $tt_1 );
    2626        $this->assertFalse( wp_cache_get( $post_id, $this->taxonomy . '_relationships' ) );
    2727
     
    4444        // Cache should be empty after a set.
    4545        $tt_2 = wp_set_object_terms( $post_id, $terms_2, $this->taxonomy );
    46         $this->assertSame( 2, count( $tt_2 ) );
     46        $this->assertCount( 2, $tt_2 );
    4747        $this->assertFalse( wp_cache_get( $post_id, $this->taxonomy . '_relationships' ) );
    4848    }
Note: See TracChangeset for help on using the changeset viewer.