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/import/parser.php

    r51335 r51367  
    107107            );
    108108
    109             $this->assertSame( 2, count( $result['posts'] ), $message );
    110             $this->assertSame( 19, count( $result['posts'][0] ), $message );
    111             $this->assertSame( 18, count( $result['posts'][1] ), $message );
     109            $this->assertCount( 2, $result['posts'], $message );
     110            $this->assertCount( 19, $result['posts'][0], $message );
     111            $this->assertCount( 18, $result['posts'][1], $message );
    112112            $this->assertEquals(
    113113                array(
     
    161161            $this->assertSame( $result['tags'][0]['tag_name'], 'chicken', $message );
    162162
    163             $this->assertSame( 6, count( $result['posts'] ), $message );
    164             $this->assertSame( 19, count( $result['posts'][0] ), $message );
    165             $this->assertSame( 18, count( $result['posts'][1] ), $message );
     163            $this->assertCount( 6, $result['posts'], $message );
     164            $this->assertCount( 19, $result['posts'][0], $message );
     165            $this->assertCount( 18, $result['posts'][1], $message );
    166166
    167167            $this->assertEquals(
Note: See TracChangeset for help on using the changeset viewer.