Tests: Use assertSame() in WP_oEmbed_Controller tests.

This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Follow-up to [41047].

Props costdev.
See #60706.

git-svn-id: https://develop.svn.wordpress.org/trunk@58044 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2024-04-24 22:03:06 +00:00
parent d898a25d1a
commit 7159243c09

View File

@ -606,8 +606,8 @@ class Test_oEmbed_Controller extends WP_UnitTestCase {
$this->assertIsObject( $data );
$this->assertSame( 'YouTube', $data->provider_name );
$this->assertSame( 'https://i.ytimg.com/vi/' . self::YOUTUBE_VIDEO_ID . '/hqdefault.jpg', $data->thumbnail_url );
$this->assertEquals( $data->width, $request['maxwidth'] );
$this->assertEquals( $data->height, $request['maxheight'] );
$this->assertSame( (int) $data->width, $request['maxwidth'] );
$this->assertSame( (int) $data->height, $request['maxheight'] );
}
/**