Skip to content

Commit df69bfb

Browse files
Tests: Use assertSame() in some newly introduced 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 [60490], [60524]. See #64324. git-svn-id: https://develop.svn.wordpress.org/trunk@61413 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 1b938a8 commit df69bfb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/phpunit/tests/feed/fetchFeed.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ public function test_fetch_feed_cached() {
5151
add_filter( 'pre_http_request', array( $filter, 'filter' ) );
5252

5353
fetch_feed( 'https://wordpress.org/news/feed/' );
54-
$this->assertEquals( 1, $filter->get_call_count(), 'The feed should be fetched on the first call.' );
54+
$this->assertSame( 1, $filter->get_call_count(), 'The feed should be fetched on the first call.' );
5555

5656
fetch_feed( 'https://wordpress.org/news/feed/' );
57-
$this->assertEquals( 1, $filter->get_call_count(), 'The feed should be cached on the second call. For SP 1.8.x upgrades, backport simplepie/simplepie#830 to resolve.' );
57+
$this->assertSame( 1, $filter->get_call_count(), 'The feed should be cached on the second call. For SP 1.8.x upgrades, backport simplepie/simplepie#830 to resolve.' );
5858
}
5959

6060
/**
@@ -79,7 +79,7 @@ public function test_fetch_feed_uses_global_cache() {
7979
switch_to_blog( $second_blog_id );
8080

8181
fetch_feed( 'https://wordpress.org/news/feed/' );
82-
$this->assertEquals( 1, $filter->get_call_count(), 'The feed cache should be global.' );
82+
$this->assertSame( 1, $filter->get_call_count(), 'The feed cache should be global.' );
8383
}
8484

8585
/**

0 commit comments

Comments
 (0)