<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[609] wp-testcase/test_user_capabilities.php: &quot;new WP_User()&quot; will always produce a WP_User instance, so let's actually test the object that was returned.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://unit-tests.trac.wordpress.org/changeset/609">609</a></dd>
<dt>Author</dt> <dd>markjaquith</dd>
<dt>Date</dt> <dd>2012-04-05 19:50:33 +0000 (Thu, 05 Apr 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>&quot;new WP_User()&quot; will always produce a WP_User instance, so let's actually test the object that was returned. We should consider an WP_User::exists() for 3.5.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#wptestcasetest_user_capabilitiesphp">wp-testcase/test_user_capabilities.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="wptestcasetest_user_capabilitiesphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_user_capabilities.php (608 => 609)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_user_capabilities.php        2012-04-05 19:28:54 UTC (rev 608)
+++ wp-testcase/test_user_capabilities.php        2012-04-05 19:50:33 UTC (rev 609)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx">         function test_user_administrator() {
</span><span class="cx">                 $id = $this-&gt;_make_user('administrator');
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user, &quot;Problem getting user $id&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user-&gt;data, &quot;Problem getting user $id&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 // make sure the role name is correct
</span><span class="cx">                 $this-&gt;assertEquals(array('administrator'), $user-&gt;roles);
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">         function test_user_editor() {
</span><span class="cx">                 $id = $this-&gt;_make_user('editor');
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user, &quot;Problem getting user $id&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user-&gt;data, &quot;Problem getting user $id&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 // make sure the role name is correct
</span><span class="cx">                 $this-&gt;assertEquals(array('editor'), $user-&gt;roles);
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx">         function test_user_author() {
</span><span class="cx">                 $id = $this-&gt;_make_user('author');
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user, &quot;Problem getting user $id&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user-&gt;data, &quot;Problem getting user $id&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 // make sure the role name is correct
</span><span class="cx">                 $this-&gt;assertEquals(array('author'), $user-&gt;roles);
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx">         function test_user_contributor() {
</span><span class="cx">                 $id = $this-&gt;_make_user('contributor');
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user, &quot;Problem getting user $id&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user-&gt;data, &quot;Problem getting user $id&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 // make sure the role name is correct
</span><span class="cx">                 $this-&gt;assertEquals(array('contributor'), $user-&gt;roles);
</span><span class="lines">@@ -122,7 +122,7 @@
</span><span class="cx">         function test_user_subscriber() {
</span><span class="cx">                 $id = $this-&gt;_make_user('subscriber');
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user, &quot;Problem getting user $id&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user-&gt;data, &quot;Problem getting user $id&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 // make sure the role name is correct
</span><span class="cx">                 $this-&gt;assertEquals(array('subscriber'), $user-&gt;roles);
</span><span class="lines">@@ -142,7 +142,7 @@
</span><span class="cx">                 _disable_wp_die();
</span><span class="cx">                 $id = $this-&gt;_make_user(rand_str());
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user, &quot;Problem getting user $id&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user-&gt;data, &quot;Problem getting user $id&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 // user has no role and no capabilities
</span><span class="cx">                 $this-&gt;assertEquals(array(), $user-&gt;roles);
</span><span class="lines">@@ -154,13 +154,13 @@
</span><span class="cx">         function test_user_subscriber_contributor() {
</span><span class="cx">                 $id = $this-&gt;_make_user('subscriber');
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user, &quot;Problem getting user $id&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user-&gt;data, &quot;Problem getting user $id&quot;);
</ins><span class="cx">                 $user-&gt;add_role('contributor');
</span><span class="cx"> 
</span><span class="cx">                 // nuke and re-fetch the object to make sure it was stored
</span><span class="cx">                 $user = NULL;
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user, &quot;Problem getting user $id&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user-&gt;data, &quot;Problem getting user $id&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 // user should have two roles now
</span><span class="cx">                 $this-&gt;assertEquals(array('subscriber', 'contributor'), $user-&gt;roles);
</span><span class="lines">@@ -189,7 +189,7 @@
</span><span class="cx">                 $id = $this-&gt;_make_user($role_name);
</span><span class="cx"> 
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user, &quot;Problem getting user $id&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user-&gt;data, &quot;Problem getting user $id&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 $this-&gt;assertEquals(array($role_name), $user-&gt;roles);
</span><span class="cx"> 
</span><span class="lines">@@ -218,7 +218,7 @@
</span><span class="cx">                 $id = $this-&gt;_make_user($role_name);
</span><span class="cx"> 
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user, &quot;Problem getting user $id&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user-&gt;data, &quot;Problem getting user $id&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 $this-&gt;assertEquals(array($role_name), $user-&gt;roles);
</span><span class="cx"> 
</span><span class="lines">@@ -259,7 +259,7 @@
</span><span class="cx">                 $this-&gt;_flush_roles();
</span><span class="cx"> 
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user, &quot;Problem getting user $id&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user-&gt;data, &quot;Problem getting user $id&quot;);
</ins><span class="cx">                 $this-&gt;assertEquals(array($role_name), $user-&gt;roles);
</span><span class="cx"> 
</span><span class="cx">                 // the user should have all the above caps
</span><span class="lines">@@ -297,7 +297,7 @@
</span><span class="cx">                 $this-&gt;_flush_roles();
</span><span class="cx"> 
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user, &quot;Problem getting user $id&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user-&gt;data, &quot;Problem getting user $id&quot;);
</ins><span class="cx">                 $this-&gt;assertEquals(array($role_name), $user-&gt;roles);
</span><span class="cx"> 
</span><span class="cx">                 // the user should have all the above caps
</span><span class="lines">@@ -324,14 +324,14 @@
</span><span class="cx"> 
</span><span class="cx">                 // user 1 has an extra capability
</span><span class="cx">                 $user_1 = new WP_User($id_1);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user_1, &quot;Problem getting user $id_1&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user_1-&gt;data, &quot;Problem getting user $id_1&quot;);
</ins><span class="cx">                 $user_1-&gt;add_cap('publish_posts');
</span><span class="cx"> 
</span><span class="cx">                 // re-fetch both users from the db
</span><span class="cx">                 $user_1 = new WP_User($id_1);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user_1, &quot;Problem getting user $id_1&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user_1-&gt;data, &quot;Problem getting user $id_1&quot;);
</ins><span class="cx">                 $user_2 = new WP_User($id_2);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user_2, &quot;Problem getting user $id_2&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user_2-&gt;data, &quot;Problem getting user $id_2&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 // make sure they're both still contributors
</span><span class="cx">                 $this-&gt;assertEquals(array('contributor'), $user_1-&gt;roles);
</span><span class="lines">@@ -361,7 +361,7 @@
</span><span class="cx"> 
</span><span class="cx">                 // user 1 has an extra capability
</span><span class="cx">                 $user_1 = new WP_User($id_1);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user_1, &quot;Problem getting user $id_1&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user_1-&gt;data, &quot;Problem getting user $id_1&quot;);
</ins><span class="cx">                 $user_1-&gt;add_cap('publish_posts');
</span><span class="cx"> 
</span><span class="cx">                 // now remove the extra cap
</span><span class="lines">@@ -369,9 +369,9 @@
</span><span class="cx"> 
</span><span class="cx">                 // re-fetch both users from the db
</span><span class="cx">                 $user_1 = new WP_User($id_1);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user_1, &quot;Problem getting user $id_1&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user_1-&gt;data, &quot;Problem getting user $id_1&quot;);
</ins><span class="cx">                 $user_2 = new WP_User($id_2);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user_2, &quot;Problem getting user $id_2&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user_2-&gt;data, &quot;Problem getting user $id_2&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 // make sure they're both still contributors
</span><span class="cx">                 $this-&gt;assertEquals(array('contributor'), $user_1-&gt;roles);
</span><span class="lines">@@ -389,7 +389,7 @@
</span><span class="cx">                 // user starts as an author
</span><span class="cx">                 $id = $this-&gt;_make_user('author');
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user, &quot;Problem getting user $id&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user-&gt;data, &quot;Problem getting user $id&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 // author = user level 2
</span><span class="cx">                 $this-&gt;assertEquals( 2, $user-&gt;user_level );
</span><span class="lines">@@ -412,7 +412,7 @@
</span><span class="cx">                 // user starts as an author
</span><span class="cx">                 $id = $this-&gt;_make_user('author');
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user, &quot;Problem getting user $id&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user-&gt;data, &quot;Problem getting user $id&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 // add some extra capabilities
</span><span class="cx">                 $user-&gt;add_cap('make_coffee');
</span><span class="lines">@@ -420,7 +420,7 @@
</span><span class="cx"> 
</span><span class="cx">                 // re-fetch
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user, &quot;Problem getting user $id&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user-&gt;data, &quot;Problem getting user $id&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 $this-&gt;assertTrue($user-&gt;has_cap('make_coffee'));
</span><span class="cx">                 $this-&gt;assertTrue($user-&gt;has_cap('drink_coffee'));
</span><span class="lines">@@ -430,7 +430,7 @@
</span><span class="cx"> 
</span><span class="cx">                 // re-fetch
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user, &quot;Problem getting user $id&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user-&gt;data, &quot;Problem getting user $id&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 // capabilities for the author role should be gone
</span><span class="cx"> #                $this-&gt;assertFalse($user-&gt;has_cap('edit_posts'));
</span><span class="lines">@@ -459,7 +459,7 @@
</span><span class="cx">                 $post = end($this-&gt;post_ids);
</span><span class="cx"> 
</span><span class="cx">                 // the author of the post
</span><del>-                $this-&gt;assertThat($author-&gt;data, $this-&gt;isType('object'));
</del><ins>+                $this-&gt;assertInternalType('object', $author-&gt;data, &quot;Problem getting user $author-&gt;ID&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 // add some other users
</span><span class="cx">                 $admin = new WP_User($this-&gt;_make_user('administrator'));
</span><span class="lines">@@ -518,7 +518,7 @@
</span><span class="cx"> 
</span><span class="cx">                 // the author of the page
</span><span class="cx">                 $author = new WP_User($this-&gt;author-&gt;ID);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $author, &quot;Problem getting user &quot; . $this-&gt;author-&gt;ID);
</del><ins>+                $this-&gt;assertInternalType('object', $author-&gt;data, &quot;Problem getting user &quot; . $this-&gt;author-&gt;ID);
</ins><span class="cx">                 $author-&gt;set_role('author');
</span><span class="cx"> 
</span><span class="cx">                 // add some other users
</span><span class="lines">@@ -552,7 +552,7 @@
</span><span class="cx"> 
</span><span class="cx">                 $id = $this-&gt;_make_user('author');
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user, &quot;Problem getting user $id&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user-&gt;data, &quot;Problem getting user $id&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 global $wpdb;
</span><span class="cx">                 if (!empty($wpdb-&gt;user_role))
</span><span class="lines">@@ -561,7 +561,7 @@
</span><span class="cx">                 update_usermeta($id, $user-&gt;cap_key, array('editor' =&gt; true));
</span><span class="cx"> 
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user, &quot;Problem getting user $id&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user-&gt;data, &quot;Problem getting user $id&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 // check a few of the main capabilities
</span><span class="cx">                 $this-&gt;assertEquals(array('editor'), $user-&gt;roles);
</span><span class="lines">@@ -595,7 +595,7 @@
</span><span class="cx"> 
</span><span class="cx">                 // regular users
</span><span class="cx">                 $user = new WP_User($id[0]);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user, &quot;Problem getting user $id[0]&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user-&gt;data, &quot;Problem getting user $id[0]&quot;);
</ins><span class="cx">                 update_usermeta($id[0], $user-&gt;cap_key, array('administrator' =&gt; true));
</span><span class="cx">                 update_usermeta($id[1], $user-&gt;cap_key, array('editor' =&gt; true));
</span><span class="cx">                 update_usermeta($id[2], $user-&gt;cap_key, array('subscriber' =&gt; true));
</span><span class="lines">@@ -613,7 +613,7 @@
</span><span class="cx"> 
</span><span class="cx">                 // test each user's role and capabilities, and make sure the usermeta data is what we expect
</span><span class="cx">                 $user_0 = new WP_User($id[0]);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user_0, &quot;Problem getting user $id[0]&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user_0-&gt;data, &quot;Problem getting user $id[0]&quot;);
</ins><span class="cx">                 $this-&gt;assertEquals(array('administrator'), $user_0-&gt;roles);
</span><span class="cx">                 $this-&gt;assertTrue($user_0-&gt;has_cap('switch_themes'));
</span><span class="cx">                 $this-&gt;assertTrue($user_0-&gt;has_cap('edit_users'));
</span><span class="lines">@@ -623,7 +623,7 @@
</span><span class="cx">                 $this-&gt;assertEquals( array(), $old_caps );
</span><span class="cx"> 
</span><span class="cx">                 $user_1 = new WP_User($id[1]);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user_1, &quot;Problem getting user $id[1]&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user_1-&gt;data, &quot;Problem getting user $id[1]&quot;);
</ins><span class="cx">                 $this-&gt;assertEquals(array('editor'), $user_1-&gt;roles);
</span><span class="cx">                 $this-&gt;assertTrue($user_1-&gt;has_cap('moderate_comments'));
</span><span class="cx">                 $this-&gt;assertTrue($user_1-&gt;has_cap('manage_categories'));
</span><span class="lines">@@ -636,7 +636,7 @@
</span><span class="cx">                 $this-&gt;assertEquals( array(), $old_caps );
</span><span class="cx"> 
</span><span class="cx">                 $user_2 = new WP_User($id[2]);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user_2, &quot;Problem getting user $id[2]&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user_2-&gt;data, &quot;Problem getting user $id[2]&quot;);
</ins><span class="cx">                 $this-&gt;assertEquals(array('subscriber'), $user_2-&gt;roles);
</span><span class="cx">                 $this-&gt;assertTrue($user_2-&gt;has_cap('read'));
</span><span class="cx">                 $this-&gt;assertTrue($user_2-&gt;has_cap('level_0'));
</span><span class="lines">@@ -648,7 +648,7 @@
</span><span class="cx"> 
</span><span class="cx">                 // user 3 has two roles
</span><span class="cx">                 $user_3 = new WP_User($id[3]);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user_3, &quot;Problem getting user $id[3]&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user_3-&gt;data, &quot;Problem getting user $id[3]&quot;);
</ins><span class="cx">                 $this-&gt;assertEquals(array('contributor', 'author'), $user_3-&gt;roles);
</span><span class="cx">                 $this-&gt;assertTrue($user_3-&gt;has_cap('edit_posts'));
</span><span class="cx">                 $this-&gt;assertTrue($user_3-&gt;has_cap('edit_published_posts'));
</span><span class="lines">@@ -662,7 +662,7 @@
</span><span class="cx"> 
</span><span class="cx">                 // user 4 is a subscriber with some extra per-user caps
</span><span class="cx">                 $user_4 = new WP_User($id[4]);
</span><del>-                $this-&gt;assertInstanceOf('WP_User', $user_4, &quot;Problem getting user $id[4]&quot;);
</del><ins>+                $this-&gt;assertInternalType('object', $user_4-&gt;data, &quot;Problem getting user $id[4]&quot;);
</ins><span class="cx">                 $this-&gt;assertEquals(array('subscriber'), $user_4-&gt;roles);
</span><span class="cx">                 $this-&gt;assertTrue($user_4-&gt;has_cap('read'));
</span><span class="cx">                 $this-&gt;assertTrue($user_4-&gt;has_cap('level_0'));
</span></span></pre>
</div>
</div>

</body>
</html>