mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Unit Tests: The assertEqualSets() helper was returning true for some sets that were not equal. assertEqualSets() now behaves correctly, and the new assertEqualSetsWithIndex() helper also checks that the array indexes are the same.
Fixes #30522. git-svn-id: https://develop.svn.wordpress.org/trunk@30687 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -262,8 +262,15 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase {
|
||||
}
|
||||
|
||||
function assertEqualSets( $expected, $actual ) {
|
||||
$this->assertEquals( array(), array_diff( $expected, $actual ) );
|
||||
$this->assertEquals( array(), array_diff( $actual, $expected ) );
|
||||
sort( $expected );
|
||||
sort( $actual );
|
||||
$this->assertEquals( $expected, $actual );
|
||||
}
|
||||
|
||||
function assertEqualSetsWithIndex( $expected, $actual ) {
|
||||
ksort( $expected );
|
||||
ksort( $actual );
|
||||
$this->assertEquals( $expected, $actual );
|
||||
}
|
||||
|
||||
function go_to( $url ) {
|
||||
|
||||
Reference in New Issue
Block a user