[wp-trac] [WordPress Trac] #43218: PHPUnit 7.x support

WordPress Trac noreply at wordpress.org
Fri Mar 9 19:41:04 UTC 2018


#43218: PHPUnit 7.x support
------------------------------+-----------------------------
 Reporter:  ayeshrajans       |       Owner:  SergeyBiryukov
     Type:  defect (bug)      |      Status:  accepted
 Priority:  normal            |   Milestone:  5.0
Component:  Build/Test Tools  |     Version:  trunk
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |     Focuses:
------------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * keywords:  has-patch => has-patch commit
 * owner:   => SergeyBiryukov
 * status:  new => accepted


Comment:

 [attachment:43218.3.diff] should fix all the failures. Tested on PHP
 5.2.17 with PHPUnit 3.6.12 and PHP 7.2.2 with PHPUnit 7.0.2.

 Was going to commit, but it was blocked by a pre-commit hook:
 {{{
 Commit failed (details follow):
 Commit blocked by pre-commit hook (exit code 1) with output:

 ***********************************
 PHP error in: trunk/tests/phpunit/includes/phpunit7/speed-trap-
 listener.php:

 Parse error: syntax error, unexpected ':', expecting ';' or '{' in
  trunk/tests/phpunit/includes/phpunit7/speed-trap-listener.php on line 57
 Errors parsing trunk/tests/phpunit/includes/phpunit7/speed-trap-
 listener.php
 }}}

 The line in question is:
 {{{
 public function addError( PHPUnit\Framework\Test $test, Throwable $t,
 float $time ): void {
 }}}
 Apparently the linter on the pre-commit hook does not support PHP7 return
 type declarations.

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


More information about the wp-trac mailing list