mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +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:
@@ -1265,10 +1265,10 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
$this->assertTrue( $actual['done'] );
|
||||
|
||||
// Number of exported comments.
|
||||
$this->assertSame( 1, count( $actual['data'] ) );
|
||||
$this->assertCount( 1, $actual['data'] );
|
||||
|
||||
// Number of exported comment properties.
|
||||
$this->assertSame( 8, count( $actual['data'][0]['data'] ) );
|
||||
$this->assertCount( 8, $actual['data'][0]['data'] );
|
||||
|
||||
// Exported group.
|
||||
$this->assertSame( 'comments', $actual['data'][0]['group_id'] );
|
||||
@@ -1328,10 +1328,10 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
$this->assertTrue( $actual['done'] );
|
||||
|
||||
// Number of exported comments.
|
||||
$this->assertSame( 1, count( $actual['data'] ) );
|
||||
$this->assertCount( 1, $actual['data'] );
|
||||
|
||||
// Number of exported comment properties.
|
||||
$this->assertSame( 7, count( $actual['data'][0]['data'] ) );
|
||||
$this->assertCount( 7, $actual['data'][0]['data'] );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1359,6 +1359,6 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
$this->assertTrue( $actual['done'] );
|
||||
|
||||
// Number of exported comments.
|
||||
$this->assertSame( 0, count( $actual['data'] ) );
|
||||
$this->assertCount( 0, $actual['data'] );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user