Changeset 29933 for trunk/tests/phpunit/tests/query/dateQuery.php
- Timestamp:
- 10/17/2014 01:19:03 AM (12 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/query/dateQuery.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/query/dateQuery.php
r29923 r29933 611 611 612 612 public function test_date_params_monthnum_m_duplicate() { 613 global $wpdb; 614 613 615 $this->create_posts(); 614 616 … … 630 632 $this->assertEquals( $expected_dates, wp_list_pluck( $posts, 'post_date' ) ); 631 633 632 $this->assertContains( "MONTH( post_date ) = 5", $this->q->request );633 $this->assertNotContains( "MONTH( post_date ) = 9", $this->q->request );634 $this->assertContains( "MONTH( $wpdb->posts.post_date ) = 5", $this->q->request ); 635 $this->assertNotContains( "MONTH( $wpdb->posts.post_date ) = 9", $this->q->request ); 634 636 } 635 637 636 638 public function test_date_params_week_w_duplicate() { 639 global $wpdb; 640 637 641 $this->create_posts(); 638 642 … … 653 657 $this->assertEquals( $expected_dates, wp_list_pluck( $posts, 'post_date' ) ); 654 658 655 $this->assertContains( "WEEK( post_date, 1 ) = 21", $this->q->request ); 656 $this->assertNotContains( "WEEK( post_date, 1 ) = 22", $this->q->request ); 659 $this->assertContains( "WEEK( $wpdb->posts.post_date, 1 ) = 21", $this->q->request ); 660 $this->assertNotContains( "WEEK( $wpdb->posts.post_date, 1 ) = 22", $this->q->request ); 661 } 662 663 /** 664 * @ticket 25775 665 */ 666 public function test_date_query_with_taxonomy_join() { 667 $p1 = $this->factory->post->create( array( 668 'post_date' => '2013-04-27 01:01:01', 669 ) ); 670 $p2 = $this->factory->post->create( array( 671 'post_date' => '2013-03-21 01:01:01', 672 ) ); 673 674 register_taxonomy( 'foo', 'post' ); 675 wp_set_object_terms( $p1, 'bar', 'foo' ); 676 677 $posts = $this->_get_query_result( array( 678 'date_query' => array( 679 'year' => 2013, 680 ), 681 'tax_query' => array( 682 array( 683 'taxonomy' => 'foo', 684 'terms' => array( 'bar' ), 685 'field' => 'name', 686 ), 687 ), 688 ) ); 689 690 _unregister_taxonomy( 'foo' ); 691 692 $this->assertEquals( array( $p1 ), wp_list_pluck( $posts, 'ID' ) ); 657 693 } 658 694
Note: See TracChangeset
for help on using the changeset viewer.