WordPress.org

Make WordPress Core

Changeset 37418


Ignore:
Timestamp:
05/11/2016 07:21:22 PM (4 years ago)
Author:
jeremyfelt
Message:

Tests: Set public to 1 in the default blog factory

When no $meta arguments are passed to wpmu_create_blog(), public is set to 0 in the database for new sites. This is fine, but also does not match the default implied when most sites are created via site-new.php.

The only current use of the $meta argument in the tests is to (re)mark public as 0. All existing tests pass with this change. Tests for WP_Site_Query can now rely on better default expectations.

See #36566.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-blog.php

    r36347 r37418  
    1616    function create_object( $args ) {
    1717        global $wpdb;
    18         $meta = isset( $args['meta'] ) ? $args['meta'] : array();
     18        $meta = isset( $args['meta'] ) ? $args['meta'] : array( 'public' => 1 );
    1919        $user_id = isset( $args['user_id'] ) ? $args['user_id'] : get_current_user_id();
    2020        // temp tables will trigger db errors when we attempt to reference them as new temp tables
Note: See TracChangeset for help on using the changeset viewer.