Code Duplication    Length = 16-16 lines in 3 locations

tests/phpunit/tests/rest-api/rest-comments-controller.php 3 locations

@@ 2597-2612 (lines=16) @@
2594
        $this->assertEquals($expected_output['author_user_agent'], $comment->comment_agent);
2595
    }
2596
2597
    public function test_comment_roundtrip_as_editor() 
2598
    {
2599
        wp_set_current_user(self::$editor_id);
2600
        $this->assertEquals(! is_multisite(), current_user_can('unfiltered_html'));
2601
        $this->verify_comment_roundtrip(
2602
            array(
2603
            'content'           => '\o/ ¯\_(ツ)_/¯',
2604
            'author_name'       => '\o/ ¯\_(ツ)_/¯',
2605
            'author_user_agent' => '\o/ ¯\_(ツ)_/¯',
2606
            ), array(
2607
            'content' => array(
2608
            'raw'      => '\o/ ¯\_(ツ)_/¯',
2609
            'rendered' => '<p>\o/ ¯\_(ツ)_/¯</p>',
2610
            ),
2611
            'author_name'       => '\o/ ¯\_(ツ)_/¯',
2612
            'author_user_agent' => '\o/ ¯\_(ツ)_/¯',
2613
            ) 
2614
        );
2615
    }
@@ 2655-2670 (lines=16) @@
2652
        }
2653
    }
2654
2655
    public function test_comment_roundtrip_as_superadmin() 
2656
    {
2657
        wp_set_current_user(self::$superadmin_id);
2658
        $this->assertTrue(current_user_can('unfiltered_html'));
2659
        $this->verify_comment_roundtrip(
2660
            array(
2661
            'content'           => '\\\&\\\ &amp; &invalid; < &lt; &amp;lt;',
2662
            'author_name'       => '\\\&\\\ &amp; &invalid; < &lt; &amp;lt;',
2663
            'author_user_agent' => '\\\&\\\ &amp; &invalid; < &lt; &amp;lt;',
2664
            ), array(
2665
            'content' => array(
2666
            'raw'      => '\\\&\\\ &amp; &invalid; < &lt; &amp;lt;',
2667
            'rendered' => '<p>\\\&#038;\\\ &amp; &invalid; < &lt; &amp;lt;' . "\n</p>",
2668
            ),
2669
            'author_name'       => '\\\&amp;\\\ &amp; &amp;invalid; &lt; &lt; &amp;lt;',
2670
            'author_user_agent' => '\\\&\\\ &amp; &invalid; &lt; &lt; &amp;lt;',
2671
            ) 
2672
        );
2673
    }
@@ 2675-2690 (lines=16) @@
2672
        );
2673
    }
2674
2675
    public function test_comment_roundtrip_as_superadmin_unfiltered_html() 
2676
    {
2677
        wp_set_current_user(self::$superadmin_id);
2678
        $this->assertTrue(current_user_can('unfiltered_html'));
2679
        $this->verify_comment_roundtrip(
2680
            array(
2681
            'content'           => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
2682
            'author_name'       => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
2683
            'author_user_agent' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
2684
            ), array(
2685
            'content' => array(
2686
            'raw'      => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
2687
            'rendered' => "<div>div</div>\n<p> <strong>strong</strong> <script>oh noes</script></p>",
2688
            ),
2689
            'author_name'       => 'div strong',
2690
            'author_user_agent' => 'div strong',
2691
            ) 
2692
        );
2693
    }