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

    r45607 r51367  
    2222        $this->wp->add_query_var( 'test' );
    2323
    24         $this->assertSame( $public_qv_count + 2, count( $this->wp->public_query_vars ) );
     24        $this->assertCount( $public_qv_count + 2, $this->wp->public_query_vars );
    2525        $this->assertTrue( in_array( 'test', $this->wp->public_query_vars, true ) );
    2626        $this->assertTrue( in_array( 'test2', $this->wp->public_query_vars, true ) );
     
    3434        $this->wp->remove_query_var( 'test' );
    3535
    36         $this->assertSame( $public_qv_count, count( $this->wp->public_query_vars ) );
     36        $this->assertCount( $public_qv_count, $this->wp->public_query_vars );
    3737    }
    3838}
Note: See TracChangeset for help on using the changeset viewer.