[wp-trac] [WordPress Trac] #54612: Disable WP_CRON when installing PHPUnit tests

WordPress Trac noreply at wordpress.org
Sat Dec 11 22:08:41 UTC 2021

#54612: Disable WP_CRON when installing PHPUnit tests
 Reporter:  Chouby        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  3.7
 Severity:  normal        |   Keywords:  has-patch
  Focuses:                |
 While running PHPunit tests for one of my plugins with PHP 8.1, I noticed
 deprecation notices in the Requests library during the WordPress
 installation process. These notices reveal in fact that an http request is
 always fired by a cron task during the WordPress installation.

 In bootstrap.php, we can find these lines:
  * Cron tries to make an HTTP request to the site, which always fails,
  * because tests are run in CLI mode only.
 define( 'DISABLE_WP_CRON', true );
 However the constant is not passed to the `install.php` script.
 I propose to add this constant in this script too.

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

More information about the wp-trac mailing list