diff --git a/tests/phpunit/tests/multisite/network.php b/tests/phpunit/tests/multisite/network.php index 5ca1632469703..71e80383f2292 100644 --- a/tests/phpunit/tests/multisite/network.php +++ b/tests/phpunit/tests/multisite/network.php @@ -126,6 +126,8 @@ public function get_main_network_id() { } /** + * Tests that the `WP_Network::$id` property is an integer. + * * @ticket 37050 * * @covers WP_Network::__get @@ -139,10 +141,10 @@ public function test_wp_network_object_id_property_is_int() { } /** - * Tests that the `WP_Network::$id` property is stored as int. + * Tests that the `WP_Network::$id` property is stored as an integer. * * Uses reflection to access the private property. - * Differs from using the public getter method, which casts to int. + * Differs from using the public getter method, which casts to an integer. * * @ticket 62035 * @@ -160,6 +162,43 @@ public function test_wp_network_object_id_property_stored_as_int() { $this->assertSame( (int) $id, $property->getValue( $network ) ); } + /** + * Tests that the `WP_Network::$blog_id` property is a string. + * + * @ticket 62035 + * + * @covers WP_Network::__get + */ + public function test_wp_network_object_blog_id_property_is_int() { + $id = self::factory()->network->create(); + + $network = WP_Network::get_instance( $id ); + + $this->assertIsString( $network->blog_id ); + } + + /** + * Tests that the `WP_Network::$blog_id` property is stored as a string. + * + * Uses reflection to access the private property. + * Differs from using the public getter method, which casts to a string. + * + * @ticket 62035 + * + * @covers WP_Network::__construct + */ + public function test_wp_network_object_blog_id_property_stored_as_string() { + $id = self::factory()->network->create(); + + $network = WP_Network::get_instance( $id ); + + $reflection = new ReflectionObject( $network ); + $property = $reflection->getProperty( 'blog_id' ); + $property->setAccessible( true ); + + $this->assertIsString( $property->getValue( $network ) ); + } + /** * @ticket 22917 */