Code Duplication    Length = 27-31 lines in 2 locations

tests/phpunit/tests/user/query.php 2 locations

@@ 767-797 (lines=31) @@
764
    /**
765
     * @ticket 32019
766
     */
767
    public function test_who_authors_should_work_alongside_meta_query() 
768
    {
769
        if (! is_multisite() ) {
770
            $this->markTestSkipped(__METHOD__ . ' requires multisite.');
771
        }
772
773
        $b = self::factory()->blog->create();
774
775
        add_user_to_blog($b, self::$author_ids[0], 'subscriber');
776
        add_user_to_blog($b, self::$author_ids[1], 'author');
777
        add_user_to_blog($b, self::$author_ids[2], 'editor');
778
779
        add_user_meta(self::$author_ids[1], 'foo', 'bar');
780
        add_user_meta(self::$author_ids[2], 'foo', 'baz');
781
782
        $q = new WP_User_Query(
783
            array(
784
            'who' => 'authors',
785
            'blog_id' => $b,
786
            'meta_query' => array(
787
            array(
788
            'key' => 'foo',
789
            'value' => 'bar',
790
            )
791
            ),
792
            ) 
793
        );
794
795
        $found = wp_list_pluck($q->get_results(), 'ID');
796
797
        $this->assertNotContains(self::$author_ids[0], $found);
798
        $this->assertContains(self::$author_ids[1], $found);
799
        $this->assertNotContains(self::$author_ids[2], $found);
800
    }
@@ 805-831 (lines=27) @@
802
    /**
803
     * @ticket 36724
804
     */
805
    public function test_who_authors_should_work_alongside_meta_params() 
806
    {
807
        if (! is_multisite() ) {
808
            $this->markTestSkipped(__METHOD__ . ' requires multisite.');
809
        }
810
811
        $b = self::factory()->blog->create();
812
813
        add_user_to_blog($b, self::$author_ids[0], 'subscriber');
814
        add_user_to_blog($b, self::$author_ids[1], 'author');
815
        add_user_to_blog($b, self::$author_ids[2], 'editor');
816
817
        add_user_meta(self::$author_ids[1], 'foo', 'bar');
818
        add_user_meta(self::$author_ids[2], 'foo', 'baz');
819
820
        $q = new WP_User_Query(
821
            array(
822
            'who' => 'authors',
823
            'blog_id' => $b,
824
            'meta_key' => 'foo',
825
            'meta_value' => 'bar',
826
            ) 
827
        );
828
829
        $found = wp_list_pluck($q->get_results(), 'ID');
830
831
        $this->assertNotContains(self::$author_ids[0], $found);
832
        $this->assertContains(self::$author_ids[1], $found);
833
        $this->assertNotContains(self::$author_ids[2], $found);
834
    }