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
This commit is contained in:
Sergey Biryukov
2022-11-10 13:05:57 +00:00
parent 551c3d6619
commit 302ba4f45f

View File

@@ -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 );
}