[wp-trac] [WordPress Trac] #39367: Don't no-op $user_id in test suite's wp_set_auth_cookie()

WordPress Trac noreply at wordpress.org
Mon Jan 16 20:15:28 UTC 2017


#39367: Don't no-op $user_id in test suite's wp_set_auth_cookie()
------------------------------+------------------
 Reporter:  danielbachhuber   |       Owner:
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  4.8
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  needs-patch       |     Focuses:
------------------------------+------------------

Comment (by danielbachhuber):

 Replying to [comment:5 jnylen0]:
 > Replying to [comment:4 johnbillion]:
 > > Overriding this function in the test suite is asking for trouble.
 >
 > What kind of trouble would you expect to see?

 I actually ran into the trouble when I opened the issue originally. WP
 SAML Auth defines `wp_set_auth_cookie()` in its [https://github.com
 /pantheon-systems/wp-saml-
 auth/blob/master/tests/phpunit/bootstrap.php#L37-L45 bootstrap.php] to
 overload the behavior of `wp_set_auth_cookie()` in `pluggable.php`. When
 core's test suite began to define `wp_set_auth_cookie()` too, it caused
 fatal errors in WP SAML Auth's tests.

 I agree with @johnbillion that defining pluggable functions in core's test
 suite is less than ideal.

 > > The pluggable function should be refactored to make it testable.
 >
 > I think this could be done later, and the simple patch here is probably
 fine for this ticket - the function is already being overridden in trunk
 and 4.7.

 We should undo the function being overridden sooner rather than later.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39367#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list