Changeset 25590
- Timestamp:
- 09/24/2013 01:19:27 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-functions.php
r25488 r25590 2043 2043 2044 2044 if ( isset( $args['archived'] ) ) 2045 $query .= $wpdb->prepare( "AND archived = % s ", (int) $args['archived'] ); // ENUM field2045 $query .= $wpdb->prepare( "AND archived = %d ", $args['archived'] ); 2046 2046 2047 2047 if ( isset( $args['mature'] ) ) -
trunk/tests/phpunit/tests/ms.php
r25488 r25590 1090 1090 $this->assertCount( 0, wp_get_sites( array( 'offset' => 20 ) ) ); 1091 1091 } 1092 1093 /**1094 * Test the 'archived' argument for wp_get_sites().1095 *1096 * archived is an ENUM, not an integer field.1097 * ENUM('0', '1') means '0' is index 1 and '1' is index 2.1098 * `WHERE archived = 1` is like saying `WHERE archived = '0'`.1099 * `WHERE archived = 0` would produce no results.1100 *1101 * @ticket 145111102 */1103 function test_wp_get_sites_archived_enum() {1104 global $wpdb;1105 $id = $this->factory->blog->create( array( 'site_id' => 2, 'meta' => array( 'archived' => '1' ) ) );1106 $this->factory->blog->create( array( 'site_id' => 2, 'meta' => array( 'archived' => '0' ) ) );1107 $results = wp_get_sites( array( 'network_id' => 2, 'archived' => 1 ) );1108 $this->assertCount( 1, $results );1109 $this->assertEquals( $id, $results[0]['blog_id'], "This query is wrong:\n" . $wpdb->last_query );1110 }1111 1092 } 1112 1093
Note: See TracChangeset
for help on using the changeset viewer.