[wp-trac] [WordPress Trac] #50640: [PHPUnit] Mark test as skipped instead of failing if GD extension is not availble

WordPress Trac noreply at wordpress.org
Wed Nov 11 02:35:12 UTC 2020


#50640: [PHPUnit] Mark test as skipped instead of failing if GD extension is not
availble
-------------------------------------------------+-------------------------
 Reporter:  ayeshrajans                          |       Owner:
                                                 |  SergeyBiryukov
     Type:  task (blessed)                       |      Status:  reopened
 Priority:  normal                               |   Milestone:  5.6
Component:  Build/Test Tools                     |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  php8 dev-feedback has-patch has-     |     Focuses:
  unit-tests                                     |
-------------------------------------------------+-------------------------

Comment (by jamescollins):

 Hi @SergeyBiryukov,

 Replying to [comment:33 SergeyBiryukov]:
 > Thanks for bringing that up! I think the PHP check can depend on the
 existing `WP_RUN_CORE_TESTS` constant.

 That's a great suggestion I think, so I've gone ahead and submitted a
 patch/PR that implements that change.


 > Not sure what to do with the Composer dependency though, should we
 remove that and only rely on the PHP check?

 That decision could go either way I think. When installing WordPress core
 via composer, we don't know if the user intends to run the core unit tests
 at that point.

 Given that the GD dependency check runs during bootstrap by default, I
 vote to remove `ext-gd` from composer.json, and just rely on the bootstrap
 check. That way composer installs aren't restricted and continue to be
 flexible depending on the use case.

 And then if a user really doesn't intend to run the core unit tests and
 they're encountering the GD check during bootstrap, they can set
 `WP_RUN_CORE_TESTS` to false and all will be well.

 Let me know if you want me to update my patch/PR to remove the composer
 dependency check too.

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


More information about the wp-trac mailing list