Make WordPress Core


Ignore:
Timestamp:
02/21/2020 01:05:39 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Build/Test Tools: Fix the Travis CI build for the 3.8 branch.

Among other fixes, this backports [26871], [26909-26910], [26940], [27086], [27168], [28799], [28873], [28943], [28961], [28964], [28966-28967], [29120], [29251], [29503], [29860], [29869], [29954], [30001], [30160], [30282], [30285], [30289-30291], [30513-30514], [30516-30521], [30524], [30526], [30529-30530], [31253-31254], [31257-31259], [31622], [40241], [40255], [40257], [40259], [40269], [40271], [40446], [40449], [40457], [40604], [40538], [40833], [41082], [41303], [41306], [44993].

See #49485.

Location:
branches/3.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.8

  • branches/3.8/tests/phpunit/tests/option/blogOption.php

    r26252 r47338  
    2020        parent::tearDown();
    2121        $wpdb->suppress_errors( $this->suppress );
    22     }
    23 
    24     function test_from_same_site() {
    25         $key = rand_str();
    26         $key2 = rand_str();
    27         $value = rand_str();
    28         $value2 = rand_str();
    29 
    30         $this->assertFalse( get_blog_option( 1, 'doesnotexist' ) );
    31         $this->assertFalse( get_option( 'doesnotexist' ) ); // check get_option()
    32 
    33         $this->assertTrue( add_blog_option( 1, $key, $value ) );
    34         // Assert all values of $blog_id that means the current or main blog (the same here).
    35         $this->assertEquals( $value, get_blog_option( 1, $key ) );
    36         $this->assertEquals( $value, get_blog_option( null, $key ) );
    37         $this->assertEquals( $value, get_blog_option( '1', $key ) );
    38         $this->assertEquals( $value, get_option( $key ) ); // check get_option()
    39 
    40         $this->assertFalse( add_blog_option( 1, $key, $value ) );  // Already exists
    41         $this->assertFalse( update_blog_option( 1, $key, $value ) );  // Value is the same
    42         $this->assertTrue( update_blog_option( 1, $key, $value2 ) );
    43         $this->assertEquals( $value2, get_blog_option( 1, $key ) );
    44         $this->assertEquals( $value2, get_option( $key ) ); // check get_option()
    45         $this->assertFalse( add_blog_option( 1, $key, $value ) );
    46         $this->assertEquals( $value2, get_blog_option( 1, $key ) );
    47         $this->assertEquals( $value2, get_option( $key ) ); // check get_option()
    48 
    49         $this->assertTrue( delete_blog_option( 1, $key ) );
    50         $this->assertFalse( get_blog_option( 1, $key ) );
    51         $this->assertFalse( get_option( $key ) ); // check get_option()
    52         $this->assertFalse( delete_blog_option( 1, $key ) );
    53         $this->assertTrue( update_blog_option( 1, $key2, $value2 ) );
    54         $this->assertEquals( $value2, get_blog_option( 1, $key2 ) );
    55         $this->assertEquals( $value2, get_option( $key2 ) ); // check get_option()
    56         $this->assertTrue( delete_blog_option( 1, $key2 ) );
    57         $this->assertFalse( get_blog_option( 1, $key2 ) );
    58         $this->assertFalse( get_option( $key2 ) ); // check get_option()
    59     }
    60 
    61     function test_from_same_site_with_null_blog_id() {
    62         $key = rand_str();
    63         $key2 = rand_str();
    64         $value = rand_str();
    65         $value2 = rand_str();
    66 
    67         $this->assertFalse( get_blog_option( null, 'doesnotexist' ) );
    68         $this->assertFalse( get_option( 'doesnotexist' ) ); // check get_option()
    69 
    70         $this->assertTrue( add_blog_option( null, $key, $value ) );
    71         // Assert all values of $blog_id that means the current or main blog (the same here).
    72         $this->assertEquals( $value, get_blog_option( null, $key ) );
    73         $this->assertEquals( $value, get_blog_option( null, $key ) );
    74         $this->assertEquals( $value, get_option( $key ) ); // check get_option()
    75 
    76         $this->assertFalse( add_blog_option( null, $key, $value ) );  // Already exists
    77         $this->assertFalse( update_blog_option( null, $key, $value ) );  // Value is the same
    78         $this->assertTrue( update_blog_option( null, $key, $value2 ) );
    79         $this->assertEquals( $value2, get_blog_option( null, $key ) );
    80         $this->assertEquals( $value2, get_option( $key ) ); // check get_option()
    81         $this->assertFalse( add_blog_option( null, $key, $value ) );
    82         $this->assertEquals( $value2, get_blog_option( null, $key ) );
    83         $this->assertEquals( $value2, get_option( $key ) ); // check get_option()
    84 
    85         $this->assertTrue( delete_blog_option( null, $key ) );
    86         $this->assertFalse( get_blog_option( null, $key ) );
    87         $this->assertFalse( get_option( $key ) ); // check get_option()
    88         $this->assertFalse( delete_blog_option( null, $key ) );
    89         $this->assertTrue( update_blog_option( null, $key2, $value2 ) );
    90         $this->assertEquals( $value2, get_blog_option( null, $key2 ) );
    91         $this->assertEquals( $value2, get_option( $key2 ) ); // check get_option()
    92         $this->assertTrue( delete_blog_option( null, $key2 ) );
    93         $this->assertFalse( get_blog_option( null, $key2 ) );
    94         $this->assertFalse( get_option( $key2 ) ); // check get_option()
    9522    }
    9623
Note: See TracChangeset for help on using the changeset viewer.