Code Duplication    Length = 24-24 lines in 2 locations

tests/phpunit/tests/rest-api/rest-users-controller.php 2 locations

@@ 1707-1730 (lines=24) @@
1704
        }
1705
    }
1706
1707
    public function test_user_roundtrip_as_superadmin() 
1708
    {
1709
        wp_set_current_user(self::$superadmin);
1710
        $this->assertTrue(current_user_can('unfiltered_html'));
1711
        $valid_username = is_multisite() ? 'noinvalidcharshere' : 'no-invalid-chars-here';
1712
        $this->verify_user_roundtrip(
1713
            array(
1714
            'username'    => $valid_username,
1715
            'name'        => '\\\&\\\ &amp; &invalid; < &lt; &amp;lt;',
1716
            'first_name'  => '\\\&\\\ &amp; &invalid; < &lt; &amp;lt;',
1717
            'last_name'   => '\\\&\\\ &amp; &invalid; < &lt; &amp;lt;',
1718
            'url'         => '\\\&\\\ &amp; &invalid; < &lt; &amp;lt;',
1719
            'description' => '\\\&\\\ &amp; &invalid; < &lt; &amp;lt;',
1720
            'nickname'    => '\\\&\\\ &amp; &invalid; < &lt; &amp;lt;',
1721
            'password'    => '& &amp; &invalid; < &lt; &amp;lt;',
1722
            ), array(
1723
            'username'    => $valid_username,
1724
            'name'        => '\\\&amp;\\\ &amp; &amp;invalid; &lt; &lt; &amp;lt;',
1725
            'first_name'  => '\\\&amp;\\\ &amp; &amp;invalid; &lt; &lt; &amp;lt;',
1726
            'last_name'   => '\\\&amp;\\\ &amp; &amp;invalid; &lt; &lt; &amp;lt;',
1727
            'url'         => 'http://&amp;%20&amp;%20&amp;invalid;%20%20&lt;%20&amp;lt;',
1728
            'description' => '\\\&amp;\\\ &amp; &amp;invalid; &lt; &lt; &amp;lt;',
1729
            'nickname'    => '\\\&amp;\\\ &amp; &amp;invalid; &lt; &lt; &amp;lt;',
1730
            'password'    => '& &amp; &invalid; < &lt; &amp;lt;',
1731
            ) 
1732
        );
1733
    }
@@ 1735-1758 (lines=24) @@
1732
        );
1733
    }
1734
1735
    public function test_user_roundtrip_as_superadmin_html() 
1736
    {
1737
        wp_set_current_user(self::$superadmin);
1738
        $this->assertTrue(current_user_can('unfiltered_html'));
1739
        $valid_username = is_multisite() ? 'noinvalidcharshere' : 'no-invalid-chars-here';
1740
        $this->verify_user_roundtrip(
1741
            array(
1742
            'username'    => $valid_username,
1743
            'name'        => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
1744
            'first_name'  => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
1745
            'last_name'   => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
1746
            'url'         => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
1747
            'description' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
1748
            'nickname'    => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
1749
            'password'    => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
1750
            ), array(
1751
            'username'    => $valid_username,
1752
            'name'        => 'div strong',
1753
            'first_name'  => 'div strong',
1754
            'last_name'   => 'div strong',
1755
            'url'         => 'http://divdiv/div%20strongstrong/strong%20scriptoh%20noes/script',
1756
            'description' => 'div <strong>strong</strong> oh noes',
1757
            'nickname'    => 'div strong',
1758
            'password'    => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
1759
            ) 
1760
        );
1761
    }