Changeset 59021
- Timestamp:
- 09/14/2024 09:29:25 PM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/multisite/network.php
r59020 r59021 127 127 128 128 /** 129 * Tests that the `WP_Network::$id` property is an integer. 130 * 129 131 * @ticket 37050 130 132 * … … 140 142 141 143 /** 142 * Tests that the `WP_Network::$id` property is stored as int.144 * Tests that the `WP_Network::$id` property is stored as an integer. 143 145 * 144 146 * Uses reflection to access the private property. 145 * Differs from using the public getter method, which casts to int.147 * Differs from using the public getter method, which casts to an integer. 146 148 * 147 149 * @ticket 62035 … … 159 161 160 162 $this->assertSame( (int) $id, $property->getValue( $network ) ); 163 } 164 165 /** 166 * Tests that the `WP_Network::$blog_id` property is a string. 167 * 168 * @ticket 62035 169 * 170 * @covers WP_Network::__get 171 */ 172 public function test_wp_network_object_blog_id_property_is_int() { 173 $id = self::factory()->network->create(); 174 175 $network = WP_Network::get_instance( $id ); 176 177 $this->assertIsString( $network->blog_id ); 178 } 179 180 /** 181 * Tests that the `WP_Network::$blog_id` property is stored as a string. 182 * 183 * Uses reflection to access the private property. 184 * Differs from using the public getter method, which casts to a string. 185 * 186 * @ticket 62035 187 * 188 * @covers WP_Network::__construct 189 */ 190 public function test_wp_network_object_blog_id_property_stored_as_string() { 191 $id = self::factory()->network->create(); 192 193 $network = WP_Network::get_instance( $id ); 194 195 $reflection = new ReflectionObject( $network ); 196 $property = $reflection->getProperty( 'blog_id' ); 197 $property->setAccessible( true ); 198 199 $this->assertIsString( $property->getValue( $network ) ); 161 200 } 162 201
Note: See TracChangeset
for help on using the changeset viewer.