Changeset 59020
- Timestamp:
- 09/13/2024 10:10:51 PM (5 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-network.php
r58138 r59020 132 132 public function __construct( $network ) { 133 133 foreach ( get_object_vars( $network ) as $key => $value ) { 134 $this-> $key = $value;134 $this->__set( $key, $value ); 135 135 } 136 136 -
trunk/tests/phpunit/tests/multisite/network.php
r56549 r59020 128 128 /** 129 129 * @ticket 37050 130 * 131 * @covers WP_Network::__get 130 132 */ 131 133 public function test_wp_network_object_id_property_is_int() { … … 135 137 136 138 $this->assertSame( (int) $id, $network->id ); 139 } 140 141 /** 142 * Tests that the `WP_Network::$id` property is stored as int. 143 * 144 * Uses reflection to access the private property. 145 * Differs from using the public getter method, which casts to int. 146 * 147 * @ticket 62035 148 * 149 * @covers WP_Network::__construct 150 */ 151 public function test_wp_network_object_id_property_stored_as_int() { 152 $id = self::factory()->network->create(); 153 154 $network = WP_Network::get_instance( $id ); 155 156 $reflection = new ReflectionObject( $network ); 157 $property = $reflection->getProperty( 'id' ); 158 $property->setAccessible( true ); 159 160 $this->assertSame( (int) $id, $property->getValue( $network ) ); 137 161 } 138 162
Note: See TracChangeset
for help on using the changeset viewer.