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

WordPress Trac noreply at wordpress.org
Fri Feb 2 21:54:09 UTC 2018


#43218: PHPUnit 7.x support
------------------------------+-----------------------------
 Reporter:  ayeshrajans       |      Owner:
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Build/Test Tools  |    Version:  trunk
 Severity:  normal            |   Keywords:
  Focuses:  coding-standards  |
------------------------------+-----------------------------
 PHPUnit 7.0.0 was released today, and it is not compatible with out
 PHPUnit-compat. I'm not trying to be a push-over, but I think it's good if
 we can keep up with with the latest testing frameworks.

 Apart from the changes listed in
 https://phpunit.de/announcements/phpunit-7.html , we now need to make a
 few changes to our WP tests and ideally drop support for very old
 versions.

  - phpuit6-compat: `class PHPUnit_Util_Test extends PHPUnit\Util\Test`. In
 PHPUnit 7, `PHPUnit\Util\Test` is declared final. It is not necessary to
 extend this class, so one could work this around by simply not extending
 this class (e.g https://github.com/Ayesh/wordpress-
 develop/commit/23a4b2daa823ecc6b9979815b735c9c95f223a01)
  - WP_PHPUnit_Util_Getopt class extends the now-final
 `PHPUnit_Util_Getopt`

 There are several other places that we have to make improvements.

 I hope we can make this a call for us to clean up our PHPUnit
 implementation and perhaps make this easier to manage.

 I would like to get your opinion on making the PHPUnit integration a
 separate composer package (we already install PHPUnit as a composer
 package) and require the corresponding version to run the test suite.

 This package will roughly contain the contents of
 `./tests/phpunit/includes` directory, and will provide fixtures and extend
 PHPUnit framework classes as necessary. We can have multiple versions
 where we support PHPUnit 3.x/4.x backports, 5.x compat files, and 6.x/7.x
 fixes as necessary, with Composer resolving package versions properly.

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


More information about the wp-trac mailing list