mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@51367 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -21,7 +21,7 @@ class Tests_WP extends WP_UnitTestCase {
|
||||
$this->wp->add_query_var( 'test2' );
|
||||
$this->wp->add_query_var( 'test' );
|
||||
|
||||
$this->assertSame( $public_qv_count + 2, count( $this->wp->public_query_vars ) );
|
||||
$this->assertCount( $public_qv_count + 2, $this->wp->public_query_vars );
|
||||
$this->assertTrue( in_array( 'test', $this->wp->public_query_vars, true ) );
|
||||
$this->assertTrue( in_array( 'test2', $this->wp->public_query_vars, true ) );
|
||||
}
|
||||
@@ -33,6 +33,6 @@ class Tests_WP extends WP_UnitTestCase {
|
||||
$this->assertTrue( in_array( 'test', $this->wp->public_query_vars, true ) );
|
||||
$this->wp->remove_query_var( 'test' );
|
||||
|
||||
$this->assertSame( $public_qv_count, count( $this->wp->public_query_vars ) );
|
||||
$this->assertCount( $public_qv_count, $this->wp->public_query_vars );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user