From 8c68a5c354a8e75e45a1f4672ca1e04b8ee05069 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 18 Aug 2016 19:37:23 +0000 Subject: [PATCH] Unit Tests: skip checking the value in `Tests_User:test_user_properties` for `db`. Casting to `array` is not the most elegant thing here, and various versions of PHP key protected/private fields differently when objects are cast. See [38275], #37699. git-svn-id: https://develop.svn.wordpress.org/trunk@38278 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/user.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/phpunit/tests/user.php b/tests/phpunit/tests/user.php index 65869eea4d..481fe6922e 100644 --- a/tests/phpunit/tests/user.php +++ b/tests/phpunit/tests/user.php @@ -187,6 +187,9 @@ class Tests_User extends WP_UnitTestCase { $this->assertEquals( 'foo', $user->data->$key ); // This will fail with WP < 3.3 foreach ( (array) $user as $key => $value ) { + if ( $value instanceof wpdb ) { + continue; + } $this->assertEquals( $value, $user->$key ); } }