Changeset 29940 for trunk/tests/phpunit/tests/meta/query.php
- Timestamp:
- 10/17/2014 08:20:04 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/meta/query.php
r29887 r29940 74 74 $sql = $query->get_sql( 'post', $wpdb->posts, 'ID' ); 75 75 76 $this->assertEquals( 2, substr_count( $sql['join'], 'INNER JOIN' ) );76 $this->assertEquals( 1, substr_count( $sql['join'], 'INNER JOIN' ) ); 77 77 } 78 78 … … 477 477 $sql = $query->get_sql( 'post', $wpdb->posts, 'ID', $this ); 478 478 479 // We should have 2 joins - one for my_first_key and one for my_second_key 480 $this->assertEquals( 2, substr_count( $sql['join'], 'JOIN' ) ); 481 482 // The WHERE should check my_third_key against an unaliased table 483 $this->assertEquals( 1, substr_count( $sql['where'], "$wpdb->postmeta.meta_key = 'my_third_key'" ) ); 484 479 $this->assertEquals( 3, substr_count( $sql['join'], 'JOIN' ) ); 485 480 } 486 481 … … 547 542 $this->assertSame( 0, substr_count( $sql['where'], "$wpdb->postmeta.meta_key = 'baz'" ) ); 548 543 549 // When a value exists, it's not a key-only query550 $this->assertSame( 0, substr_count( $sql['where'], "$wpdb->postmeta.meta_key = 'barry'" ) );551 552 544 // 'AND' queries don't have key-only queries 553 545 $query2 = new WP_Meta_Query( array(
Note: See TracChangeset
for help on using the changeset viewer.