* sort()
returns a boolean, not a sorted set. Move the calls out of the assertions and fix the test methods.
* Fix instances where `Only variables should be passed by reference` was being triggered by assigning `array_keys()` return value to a var See #25282. git-svn-id: https://develop.svn.wordpress.org/trunk@25394 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d58aace6f7
commit
13381bfcdc
@ -39,7 +39,10 @@ class Tests_XMLRPC_wp_getProfile extends WP_XMLRPC_UnitTestCase {
|
||||
$this->assertNotInstanceOf( 'IXR_Error', $result );
|
||||
$this->assertEquals( $editor_id, $result['user_id'] );
|
||||
|
||||
$expected_fields = array_merge( array( 'user_id' ), $fields );
|
||||
$this->assertEquals( sort( $expected_fields ), sort( array_keys( $result ) ) );
|
||||
$expected_fields = array( 'user_id', 'email', 'bio' );
|
||||
$keys = array_keys( $result );
|
||||
sort( $expected_fields );
|
||||
sort( $keys );
|
||||
$this->assertEqualSets( $expected_fields, $keys );
|
||||
}
|
||||
}
|
||||
|
@ -126,7 +126,10 @@ class Tests_XMLRPC_wp_getUser extends WP_XMLRPC_UnitTestCase {
|
||||
$this->assertEquals( $editor_id, $result['user_id'] );
|
||||
|
||||
$expected_fields = array( 'user_id', 'username', 'email', 'registered', 'display_name', 'nicename' );
|
||||
$this->assertEquals( sort( $expected_fields ), sort( array_keys( $result ) ) );
|
||||
$keys = array_keys( $result );
|
||||
sort( $expected_fields );
|
||||
sort( $keys );
|
||||
$this->assertEqualSets( $expected_fields, $keys );
|
||||
}
|
||||
|
||||
function test_arbitrary_fields() {
|
||||
@ -138,7 +141,10 @@ class Tests_XMLRPC_wp_getUser extends WP_XMLRPC_UnitTestCase {
|
||||
$this->assertNotInstanceOf( 'IXR_Error', $result );
|
||||
$this->assertEquals( $editor_id, $result['user_id'] );
|
||||
|
||||
$expected_fields = array_merge( array( 'user_id' ), $fields );
|
||||
$this->assertEquals( sort( $expected_fields ), sort( array_keys( $result ) ) );
|
||||
$expected_fields = array( 'user_id', 'email', 'bio' );
|
||||
$keys = array_keys( $result );
|
||||
sort( $expected_fields );
|
||||
sort( $keys );
|
||||
$this->assertEqualSets( $expected_fields, $keys );
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user