WordPress.org

Make WordPress Core

Changeset 37222


Ignore:
Timestamp:
04/16/2016 07:21:49 PM (4 years ago)
Author:
jeremyfelt
Message:

Tests: Run network option tests as single and multisite

The _network_option() functions are available to all and
internally use _option() functions as a fallback. We should
be testing for that scenario as well.

Fixes #36552.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/option/networkOption.php

    r35242 r37222  
    11<?php
    22
    3 if ( is_multisite() ) :
    4 
    53/**
    6  * Tests specific to network options in Multisite.
     4 * Tests specific to managing network options in multisite.
     5 *
     6 * Some tests will run in single site as the `_network_option()` functions
     7 * are available and internally use `_option()` functions as fallbacks.
    78 *
    89 * @group option
     
    1213class Tests_Option_NetworkOption extends WP_UnitTestCase {
    1314    function test_add_network_option_not_available_on_other_network() {
     15        if ( ! is_multisite() ) {
     16            $this->markTestSkipped( 'Test requires multisite' );
     17        }
     18
    1419        $id = self::factory()->network->create();
    1520        $option = rand_str();
     
    2126
    2227    function test_add_network_option_available_on_same_network() {
     28        if ( ! is_multisite() ) {
     29            $this->markTestSkipped( 'Test requires multisite' );
     30        }
     31
    2332        $id = self::factory()->network->create();
    2433        $option = rand_str();
     
    3039
    3140    function test_delete_network_option_on_only_one_network() {
     41        if ( ! is_multisite() ) {
     42            $this->markTestSkipped( 'Test requires multisite' );
     43        }
     44
    3245        $id = self::factory()->network->create();
    3346        $option = rand_str();
     
    8497    }
    8598}
    86 
    87 endif;
Note: See TracChangeset for help on using the changeset viewer.