Changeset 41058 for trunk/tests/phpunit/tests/multisite/site.php
- Timestamp:
- 07/14/2017 09:07:17 PM (9 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/multisite/site.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/multisite/site.php
r40346 r41058 11 11 class Tests_Multisite_Site extends WP_UnitTestCase { 12 12 protected $suppress = false; 13 protected static $network_ids; 13 14 14 15 function setUp() { … … 22 23 $wpdb->suppress_errors( $this->suppress ); 23 24 parent::tearDown(); 25 } 26 27 public static function wpSetUpBeforeClass( $factory ) { 28 self::$network_ids = array( 29 'make.wordpress.org/' => array( 'domain' => 'make.wordpress.org', 'path' => '/' ), 30 ); 31 32 foreach ( self::$network_ids as &$id ) { 33 $id = $factory->network->create( $id ); 34 } 35 unset( $id ); 36 } 37 38 public static function wpTearDownAfterClass() { 39 global $wpdb; 40 41 foreach( self::$network_ids as $id ) { 42 $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->sitemeta} WHERE site_id = %d", $id ) ); 43 $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->site} WHERE id= %d", $id ) ); 44 } 24 45 } 25 46 … … 982 1003 983 1004 /** 1005 * @ticket 40503 1006 */ 1007 function test_different_network_language() { 1008 $network = get_network( self::$network_ids['make.wordpress.org/'] ); 1009 1010 add_filter( 'sanitize_option_WPLANG', array( $this, 'filter_allow_unavailable_languages' ), 10, 3 ); 1011 1012 update_network_option( self::$network_ids['make.wordpress.org/'], 'WPLANG', 'wibble' ); 1013 $blog_id = wpmu_create_blog( $network->domain, '/de-de/', 'New Blog', get_current_user_id(), array(), $network->id ); 1014 1015 remove_filter( 'sanitize_option_WPLANG', array( $this, 'filter_allow_unavailable_languages' ), 10 ); 1016 1017 $this->assertSame( get_network_option( self::$network_ids['make.wordpress.org/'], 'WPLANG' ), get_blog_option( $blog_id, 'WPLANG' ) ); 1018 } 1019 1020 /** 984 1021 * Allows to set the WPLANG option to any language. 985 1022 *
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)