Code Duplication    Length = 15-15 lines in 2 locations

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

@@ 646-660 (lines=15) @@
643
        $this->assertSame('HOUR( post_date ) NOT IN (1,2) AND MINUTE( post_date ) NOT IN (3,4,5) AND SECOND( post_date ) NOT IN (6)', $found);
644
    }
645
646
    public function test_build_time_query_compare_between() 
647
    {
648
        $q = new WP_Date_Query(array());
649
650
        // Just hour
651
        $found = $q->build_time_query('post_date', 'BETWEEN', array( 1, 2 ));
652
        $this->assertSame('HOUR( post_date ) BETWEEN 1 AND 2', $found);
653
654
        // Skip minute
655
        $found = $q->build_time_query('post_date', 'BETWEEN', array( 1, 2 ), null, array( 6, 7 ));
656
        $this->assertSame('HOUR( post_date ) BETWEEN 1 AND 2 AND SECOND( post_date ) BETWEEN 6 AND 7', $found);
657
658
        // All three
659
        $found = $q->build_time_query('post_date', 'BETWEEN', array( 1, 2 ), array( 3, 4 ), array( 6, 7 ));
660
        $this->assertSame('HOUR( post_date ) BETWEEN 1 AND 2 AND MINUTE( post_date ) BETWEEN 3 AND 4 AND SECOND( post_date ) BETWEEN 6 AND 7', $found);
661
    }
662
663
    public function test_build_time_query_compare_not_between() 
@@ 663-677 (lines=15) @@
660
        $this->assertSame('HOUR( post_date ) BETWEEN 1 AND 2 AND MINUTE( post_date ) BETWEEN 3 AND 4 AND SECOND( post_date ) BETWEEN 6 AND 7', $found);
661
    }
662
663
    public function test_build_time_query_compare_not_between() 
664
    {
665
        $q = new WP_Date_Query(array());
666
667
        // Just hour
668
        $found = $q->build_time_query('post_date', 'NOT BETWEEN', array( 1, 2 ));
669
        $this->assertSame('HOUR( post_date ) NOT BETWEEN 1 AND 2', $found);
670
671
        // Skip minute
672
        $found = $q->build_time_query('post_date', 'NOT BETWEEN', array( 1, 2 ), null, array( 6, 7 ));
673
        $this->assertSame('HOUR( post_date ) NOT BETWEEN 1 AND 2 AND SECOND( post_date ) NOT BETWEEN 6 AND 7', $found);
674
675
        // All three
676
        $found = $q->build_time_query('post_date', 'NOT BETWEEN', array( 1, 2 ), array( 3, 4 ), array( 6, 7 ));
677
        $this->assertSame('HOUR( post_date ) NOT BETWEEN 1 AND 2 AND MINUTE( post_date ) NOT BETWEEN 3 AND 4 AND SECOND( post_date ) NOT BETWEEN 6 AND 7', $found);
678
    }
679
680
    public function test_build_time_query_hour_only()