From 302ba4f45f96490f5947f324228f20e0cbe28583 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 10 Nov 2022 13:05:57 +0000 Subject: [PATCH] Tests: Correct the test for `get_blogaddress_by_id()` with a non-existing ID. Due to auto-increment, when running various test groups or classes separately, in this case running all of the tests under `phpunit/tests/multisite/` by including the `--filter Tests_Multisite` parameter, it is entirely possible for the blog ID 42 to actually exist, making the test's assumption incorrect. By using `PHP_INT_MAX` instead, we can avoid a collision with a fixture of another test. Follow-up to [31157]. See #56793. git-svn-id: https://develop.svn.wordpress.org/trunk@54791 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/multisite/site.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/multisite/site.php b/tests/phpunit/tests/multisite/site.php index 990003cde9..6507fbbf22 100644 --- a/tests/phpunit/tests/multisite/site.php +++ b/tests/phpunit/tests/multisite/site.php @@ -687,10 +687,10 @@ if ( is_multisite() ) : } /** - * Tests returning the appropriate response for a invalid id given. + * Tests returning an empty string for a non-existing ID. */ public function test_get_blogaddress_by_id_with_invalid_id() { - $blogaddress = get_blogaddress_by_id( 42 ); + $blogaddress = get_blogaddress_by_id( PHP_INT_MAX ); $this->assertSame( '', $blogaddress ); }