[wp-trac] [WordPress Trac] #40724: Strict get_blog_count() unit test fails on some setups

WordPress Trac noreply at wordpress.org
Wed May 10 22:57:37 UTC 2017


#40724: Strict get_blog_count() unit test fails on some setups
--------------------------------+-------------------------
 Reporter:  flixos90            |      Owner:
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  4.8
Component:  Networks and Sites  |    Version:
 Severity:  normal              |   Keywords:  needs-patch
  Focuses:  multisite           |
--------------------------------+-------------------------
 The unit test
 `Tests_Multisite_Network::test_get_blog_count_on_different_network()`
 which was introduced in [40370] uses a very strict `assertSame()` call
 instead of `assertEquals()`. While the function `get_blog_count()` is
 supposed to return an integer according to its docs, the option is never
 cast to an integer, causing this assertion to fail.

 For some reason, this never broke unit tests on Travis, and they also
 passed on my own setup. Several people have reported the failure on their
 local setup, and it appears clear that this should be fixed. While working
 on an unrelated patch, I just encountered the test failure on my setup as
 well.

 Let's make this test stable by using `assertEquals()` instead of
 `assertSame()`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40724>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list