Make WordPress Core


Ignore:
Timestamp:
07/07/2021 10:32:56 AM (5 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/query/taxQuery.php

    r48939 r51367  
    10261026
    10271027        $posts = $query->get_posts();
    1028         $this->assertSame( 0, count( $posts ) );
     1028        $this->assertCount( 0, $posts );
    10291029    }
    10301030
     
    10611061
    10621062        $posts = $query->get_posts();
    1063         $this->assertSame( 0, count( $posts ) );
     1063        $this->assertCount( 0, $posts );
    10641064    }
    10651065
     
    11131113        );
    11141114
    1115         $this->assertSame( 4, count( $posts ) );
     1115        $this->assertCount( 4, $posts );
    11161116
    11171117        $posts = get_posts(
     
    11311131        );
    11321132
    1133         $this->assertSame( 1, count( $posts ) );
     1133        $this->assertCount( 1, $posts );
    11341134
    11351135        $posts = get_posts(
     
    11481148        );
    11491149
    1150         $this->assertSame( 3, count( $posts ) );
     1150        $this->assertCount( 3, $posts );
    11511151
    11521152        $posts = get_posts(
     
    11661166        );
    11671167
    1168         $this->assertSame( 1, count( $posts ) );
     1168        $this->assertCount( 1, $posts );
    11691169
    11701170        $posts = get_posts(
     
    11831183        );
    11841184
    1185         $this->assertSame( 1, count( $posts ) );
     1185        $this->assertCount( 1, $posts );
    11861186
    11871187        $posts = get_posts(
     
    12011201        );
    12021202
    1203         $this->assertSame( 1, count( $posts ) );
     1203        $this->assertCount( 1, $posts );
    12041204    }
    12051205
Note: See TracChangeset for help on using the changeset viewer.