|
@@ 603-609 (lines=7) @@
|
| 600 |
|
/** |
| 601 |
|
* @ticket 34228 |
| 602 |
|
*/ |
| 603 |
|
public function test_build_time_query_should_not_discard_hour_0() |
| 604 |
|
{ |
| 605 |
|
$q = new WP_Date_Query(array()); |
| 606 |
|
|
| 607 |
|
$found = $q->build_time_query('post_date', '=', 0, 10); |
| 608 |
|
|
| 609 |
|
$this->assertContains('%H', $found); |
| 610 |
|
} |
| 611 |
|
|
| 612 |
|
public function test_build_time_query_compare_in() |
|
@@ 688-694 (lines=7) @@
|
| 685 |
|
$this->assertSame('HOUR( post_date ) = 5', $found); |
| 686 |
|
} |
| 687 |
|
|
| 688 |
|
public function test_build_time_query_minute_only() |
| 689 |
|
{ |
| 690 |
|
$q = new WP_Date_Query(array()); |
| 691 |
|
|
| 692 |
|
$found = $q->build_time_query('post_date', '=', null, 5); |
| 693 |
|
$this->assertSame('MINUTE( post_date ) = 5', $found); |
| 694 |
|
} |
| 695 |
|
|
| 696 |
|
public function test_build_time_query_second_only() |
| 697 |
|
{ |
|
@@ 696-702 (lines=7) @@
|
| 693 |
|
$this->assertSame('MINUTE( post_date ) = 5', $found); |
| 694 |
|
} |
| 695 |
|
|
| 696 |
|
public function test_build_time_query_second_only() |
| 697 |
|
{ |
| 698 |
|
$q = new WP_Date_Query(array()); |
| 699 |
|
|
| 700 |
|
$found = $q->build_time_query('post_date', '=', null, null, 5); |
| 701 |
|
$this->assertSame('SECOND( post_date ) = 5', $found); |
| 702 |
|
} |
| 703 |
|
|
| 704 |
|
public function test_build_time_query_hour_and_second() |
| 705 |
|
{ |
|
@@ 704-710 (lines=7) @@
|
| 701 |
|
$this->assertSame('SECOND( post_date ) = 5', $found); |
| 702 |
|
} |
| 703 |
|
|
| 704 |
|
public function test_build_time_query_hour_and_second() |
| 705 |
|
{ |
| 706 |
|
$q = new WP_Date_Query(array()); |
| 707 |
|
|
| 708 |
|
$found = $q->build_time_query('post_date', '=', 5, null, 5); |
| 709 |
|
$this->assertFalse($found); |
| 710 |
|
} |
| 711 |
|
|
| 712 |
|
public function test_build_time_query_hour_minute() |
| 713 |
|
{ |
|
@@ 712-720 (lines=9) @@
|
| 709 |
|
$this->assertFalse($found); |
| 710 |
|
} |
| 711 |
|
|
| 712 |
|
public function test_build_time_query_hour_minute() |
| 713 |
|
{ |
| 714 |
|
$q = new WP_Date_Query(array()); |
| 715 |
|
|
| 716 |
|
$found = $q->build_time_query('post_date', '=', 5, 15); |
| 717 |
|
|
| 718 |
|
// $compare value is floating point - use regex to account for |
| 719 |
|
// varying precision on different PHP installations |
| 720 |
|
$this->assertRegExp("/DATE_FORMAT\( post_date, '%H\.%i' \) = 5\.150*/", $found); |
| 721 |
|
} |
| 722 |
|
|
| 723 |
|
public function test_build_time_query_hour_minute_second() |
|
@@ 723-731 (lines=9) @@
|
| 720 |
|
$this->assertRegExp("/DATE_FORMAT\( post_date, '%H\.%i' \) = 5\.150*/", $found); |
| 721 |
|
} |
| 722 |
|
|
| 723 |
|
public function test_build_time_query_hour_minute_second() |
| 724 |
|
{ |
| 725 |
|
$q = new WP_Date_Query(array()); |
| 726 |
|
|
| 727 |
|
$found = $q->build_time_query('post_date', '=', 5, 15, 35); |
| 728 |
|
|
| 729 |
|
// $compare value is floating point - use regex to account for |
| 730 |
|
// varying precision on different PHP installations |
| 731 |
|
$this->assertRegExp("/DATE_FORMAT\( post_date, '%H\.%i%s' \) = 5\.15350*/", $found); |
| 732 |
|
} |
| 733 |
|
|
| 734 |
|
public function test_build_time_query_minute_second() |
|
@@ 734-742 (lines=9) @@
|
| 731 |
|
$this->assertRegExp("/DATE_FORMAT\( post_date, '%H\.%i%s' \) = 5\.15350*/", $found); |
| 732 |
|
} |
| 733 |
|
|
| 734 |
|
public function test_build_time_query_minute_second() |
| 735 |
|
{ |
| 736 |
|
$q = new WP_Date_Query(array()); |
| 737 |
|
|
| 738 |
|
$found = $q->build_time_query('post_date', '=', null, 15, 35); |
| 739 |
|
|
| 740 |
|
// $compare value is floating point - use regex to account for |
| 741 |
|
// varying precision on different PHP installations |
| 742 |
|
$this->assertRegExp("/DATE_FORMAT\( post_date, '0\.%i%s' \) = 0\.15350*/", $found); |
| 743 |
|
} |
| 744 |
|
|
| 745 |
|
/** |