<!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>[795] trunk/wp-testcase/test_user_capabilities.php: Remove tests for a patch on #WP5540.</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/795">795</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2012-06-30 19:39:26 +0000 (Sat, 30 Jun 2012)</dd>
</dl>
<h3>Log Message</h3>
<pre>Remove tests for a patch on #WP5540. (The ticket got closed as wontfix.)</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwptestcasetest_user_capabilitiesphp">trunk/wp-testcase/test_user_capabilities.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwptestcasetest_user_capabilitiesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-testcase/test_user_capabilities.php (794 => 795)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-testcase/test_user_capabilities.php        2012-06-30 19:38:48 UTC (rev 794)
+++ trunk/wp-testcase/test_user_capabilities.php        2012-06-30 19:39:26 UTC (rev 795)
</span><span class="lines">@@ -571,115 +571,6 @@
</span><span class="cx">                 $this->assertFalse($user->has_cap('level_8'));
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        function test_upgrade() {
-                // only relevant with this patch
-                $this->knownWPBug(5540);
-
-                if ( !is_callable('upgrade_user_roles') )
-                        $this->markTestSkipped('depends on patch #5540');
-
-                global $wpdb, $blog_id;
-
-                // make some users with old style usermeta roles and caps
-                $id = array();
-                for ($i=0; $i<5; $i++) {
-                        $id[$i] = $this->factory->user->create( array( 'role' => '' ) );
-                        $wpdb->query("DELETE FROM {$wpdb->user_role} WHERE user_id = {$id[$i]}");
-                }
-
-                // regular users
-                $user = new WP_User($id[0]);
-                $this->assertTrue($user->exists(), "Problem getting user $id[0]");
-                update_usermeta($id[0], $user->cap_key, array('administrator' => true));
-                update_usermeta($id[1], $user->cap_key, array('editor' => true));
-                update_usermeta($id[2], $user->cap_key, array('subscriber' => true));
-                // a user with 2 roles
-                update_usermeta($id[3], $user->cap_key, array('contributor' => true, 'author' => true));
-                // a user with per-user capabilities
-                update_usermeta($id[4], $user->cap_key, array('subscriber' => true, 'edit_posts' => true, 'upload_files' => true));
-
-                upgrade_user_roles($wpdb->prefix, $blog_id);
-
-                // make sure the upgrade did insert user_role rows
-                foreach ( $id as $user_id ) {
-                        $this->assertTrue( $wpdb->get_row("SELECT user_role_id FROM {$wpdb->user_role} WHERE user_id = {$user_id}") > 0 );
-                }
-
-                // test each user's role and capabilities, and make sure the usermeta data is what we expect
-                $user_0 = new WP_User($id[0]);
-                $this->assertTrue($user_0->exists(), "Problem getting user $id[0]");
-                $this->assertEquals(array('administrator'), $user_0->roles);
-                $this->assertTrue($user_0->has_cap('switch_themes'));
-                $this->assertTrue($user_0->has_cap('edit_users'));
-                $this->assertTrue($user_0->has_cap('manage_options'));
-                $this->assertTrue($user_0->has_cap('level_10'));
-                $old_caps = get_usermeta($id[0], $user_0->cap_key);
-                $this->assertEquals( array(), $old_caps );
-
-                $user_1 = new WP_User($id[1]);
-                $this->assertTrue($user_1->exists(), "Problem getting user $id[1]");
-                $this->assertEquals(array('editor'), $user_1->roles);
-                $this->assertTrue($user_1->has_cap('moderate_comments'));
-                $this->assertTrue($user_1->has_cap('manage_categories'));
-                $this->assertTrue($user_1->has_cap('upload_files'));
-                $this->assertTrue($user_1->has_cap('level_7'));
-                $this->assertFalse($user_1->has_cap('switch_themes'));
-                $this->assertFalse($user_1->has_cap('edit_users'));
-                $this->assertFalse($user_1->has_cap('level_8'));
-                $old_caps = get_usermeta($id[1], $user_1->cap_key);
-                $this->assertEquals( array(), $old_caps );
-
-                $user_2 = new WP_User($id[2]);
-                $this->assertTrue($user_2->exists(), "Problem getting user $id[2]");
-                $this->assertEquals(array('subscriber'), $user_2->roles);
-                $this->assertTrue($user_2->has_cap('read'));
-                $this->assertTrue($user_2->has_cap('level_0'));
-                $this->assertFalse($user_2->has_cap('upload_files'));
-                $this->assertFalse($user_2->has_cap('edit_posts'));
-                $this->assertFalse($user_2->has_cap('level_1'));
-                $old_caps = get_usermeta($id[2], $user_2->cap_key);
-                $this->assertEquals( array(), $old_caps );
-
-                // user 3 has two roles
-                $user_3 = new WP_User($id[3]);
-                $this->assertTrue($user_3->exists(), "Problem getting user $id[3]");
-                $this->assertEquals(array('contributor', 'author'), $user_3->roles);
-                $this->assertTrue($user_3->has_cap('edit_posts'));
-                $this->assertTrue($user_3->has_cap('edit_published_posts'));
-                $this->assertTrue($user_3->has_cap('upload_files'));
-                $this->assertTrue($user_3->has_cap('level_2'));
-                $this->assertFalse($user_3->has_cap('moderate_comments'));
-                $this->assertFalse($user_3->has_cap('manage_categories'));
-                $this->assertFalse($user_3->has_cap('level_3'));
-                $old_caps = get_usermeta($id[3], $user_3->cap_key);
-                $this->assertEquals( array(), $old_caps );
-
-                // user 4 is a subscriber with some extra per-user caps
-                $user_4 = new WP_User($id[4]);
-                $this->assertTrue($user_4->exists(), "Problem getting user $id[4]");
-                $this->assertEquals(array('subscriber'), $user_4->roles);
-                $this->assertTrue($user_4->has_cap('read'));
-                $this->assertTrue($user_4->has_cap('level_0'));
-                $this->assertFalse($user_4->has_cap('edit_users'));
-                $this->assertFalse($user_4->has_cap('level_1'));
-                // extra caps
-                $this->assertTrue($user_4->has_cap('edit_posts'));
-                $this->assertTrue($user_4->has_cap('upload_files'));
-                // the extra caps should still be stored in usermeta
-                $old_caps = get_usermeta($id[4], $user_4->cap_key);
-                $this->assertEquals( array('edit_posts' => true, 'upload_files' => true), $old_caps );
-
-                // quick test for get_users_of_blog
-                $users = get_users_of_blog();
-                #dmp('orig users', $this->orig_users);
-                #dmp('now users', $users);
-                $this->assertEquals( 5, count($users) - count($this->orig_users) );
-
-                #dmp('get_roles_with_cap edit_posts', get_roles_with_cap('edit_posts'));
-                #dmp('get_users_of_blog', get_users_of_blog());
-                #dmp('get_users_with_cap edit_posts', get_users_with_cap('edit_posts'));
-        }
-
</del><span class="cx">         function _test_generate_role_thingy() {
</span><span class="cx">                 global $wp_roles;
</span><span class="cx">                 foreach (array_keys($wp_roles->roles) as $role) {
</span></span></pre>
</div>
</div>
</body>
</html>