|
@@ 612-626 (lines=15) @@
|
| 609 |
|
$this->assertContains('%H', $found); |
| 610 |
|
} |
| 611 |
|
|
| 612 |
|
public function test_build_time_query_compare_in() |
| 613 |
|
{ |
| 614 |
|
$q = new WP_Date_Query(array()); |
| 615 |
|
|
| 616 |
|
// Just hour |
| 617 |
|
$found = $q->build_time_query('post_date', 'IN', array( 1, 2 )); |
| 618 |
|
$this->assertSame('HOUR( post_date ) IN (1,2)', $found); |
| 619 |
|
|
| 620 |
|
// Skip minute |
| 621 |
|
$found = $q->build_time_query('post_date', 'IN', array( 1, 2 ), null, 6); |
| 622 |
|
$this->assertSame('HOUR( post_date ) IN (1,2) AND SECOND( post_date ) IN (6)', $found); |
| 623 |
|
|
| 624 |
|
// All three |
| 625 |
|
$found = $q->build_time_query('post_date', 'IN', array( 1, 2 ), array( 3, 4, 5 ), 6); |
| 626 |
|
$this->assertSame('HOUR( post_date ) IN (1,2) AND MINUTE( post_date ) IN (3,4,5) AND SECOND( post_date ) IN (6)', $found); |
| 627 |
|
} |
| 628 |
|
|
| 629 |
|
public function test_build_time_query_compare_not_in() |
|
@@ 629-643 (lines=15) @@
|
| 626 |
|
$this->assertSame('HOUR( post_date ) IN (1,2) AND MINUTE( post_date ) IN (3,4,5) AND SECOND( post_date ) IN (6)', $found); |
| 627 |
|
} |
| 628 |
|
|
| 629 |
|
public function test_build_time_query_compare_not_in() |
| 630 |
|
{ |
| 631 |
|
$q = new WP_Date_Query(array()); |
| 632 |
|
|
| 633 |
|
// Just hour |
| 634 |
|
$found = $q->build_time_query('post_date', 'NOT IN', array( 1, 2 )); |
| 635 |
|
$this->assertSame('HOUR( post_date ) NOT IN (1,2)', $found); |
| 636 |
|
|
| 637 |
|
// Skip minute |
| 638 |
|
$found = $q->build_time_query('post_date', 'NOT IN', array( 1, 2 ), null, 6); |
| 639 |
|
$this->assertSame('HOUR( post_date ) NOT IN (1,2) AND SECOND( post_date ) NOT IN (6)', $found); |
| 640 |
|
|
| 641 |
|
// All three |
| 642 |
|
$found = $q->build_time_query('post_date', 'NOT IN', array( 1, 2 ), array( 3, 4, 5 ), 6); |
| 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() |