From 4429638da60c92b8e5ed7255a9c4375505ada84d Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Wed, 11 May 2016 19:21:22 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@37418 602fd350-edb4-49c9-b593-d223f7449a82 --- .../includes/factory/class-wp-unittest-factory-for-blog.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/includes/factory/class-wp-unittest-factory-for-blog.php b/tests/phpunit/includes/factory/class-wp-unittest-factory-for-blog.php index 84f339a5bd..8f73133b14 100644 --- a/tests/phpunit/includes/factory/class-wp-unittest-factory-for-blog.php +++ b/tests/phpunit/includes/factory/class-wp-unittest-factory-for-blog.php @@ -15,7 +15,7 @@ class WP_UnitTest_Factory_For_Blog extends WP_UnitTest_Factory_For_Thing { function create_object( $args ) { global $wpdb; - $meta = isset( $args['meta'] ) ? $args['meta'] : array(); + $meta = isset( $args['meta'] ) ? $args['meta'] : array( 'public' => 1 ); $user_id = isset( $args['user_id'] ) ? $args['user_id'] : get_current_user_id(); // temp tables will trigger db errors when we attempt to reference them as new temp tables $suppress = $wpdb->suppress_errors();