Changeset 30003 for trunk/tests/phpunit/tests/comment/query.php
- Timestamp:
- 10/24/2014 02:33:46 AM (12 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/comment/query.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/query.php
r29982 r30003 517 517 $this->assertEquals( array( $c1, $c2, $c3, $c4, $c5 ), $found ); 518 518 } 519 520 public function test_orderby_default() { 521 $q = new WP_Comment_Query(); 522 $q->query( array() ); 523 524 $this->assertContains( 'ORDER BY comment_date_gmt', $q->request ); 525 } 526 527 public function test_orderby_single() { 528 $q = new WP_Comment_Query(); 529 $q->query( array( 530 'orderby' => 'comment_agent', 531 ) ); 532 533 $this->assertContains( 'ORDER BY comment_agent', $q->request ); 534 } 535 536 public function test_orderby_single_invalid() { 537 $q = new WP_Comment_Query(); 538 $q->query( array( 539 'orderby' => 'foo', 540 ) ); 541 542 $this->assertContains( 'ORDER BY comment_date_gmt', $q->request ); 543 } 544 545 public function test_orderby_comma_separated() { 546 $q = new WP_Comment_Query(); 547 $q->query( array( 548 'orderby' => 'comment_agent, comment_approved', 549 ) ); 550 551 $this->assertContains( 'ORDER BY comment_agent, comment_approved', $q->request ); 552 } 553 554 public function test_orderby_array() { 555 $q = new WP_Comment_Query(); 556 $q->query( array( 557 'orderby' => array( 'comment_agent', 'comment_approved' ), 558 ) ); 559 560 $this->assertContains( 'ORDER BY comment_agent, comment_approved', $q->request ); 561 } 562 563 public function test_orderby_array_contains_invalid_item() { 564 $q = new WP_Comment_Query(); 565 $q->query( array( 566 'orderby' => array( 'comment_agent', 'foo', 'comment_approved' ), 567 ) ); 568 569 $this->assertContains( 'ORDER BY comment_agent, comment_approved', $q->request ); 570 } 571 572 public function test_orderby_array_contains_all_invalid_items() { 573 $q = new WP_Comment_Query(); 574 $q->query( array( 575 'orderby' => array( 'foo', 'bar', 'baz' ), 576 ) ); 577 578 $this->assertContains( 'ORDER BY comment_date_gmt', $q->request ); 579 } 519 580 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)