penske-media-corp / pmc-unit-test

PMC WordPress unit test framework
GNU General Public License v2.0
7 stars 1 forks source link

PASE-1455 | Bugfix: Switch `Http` mock from final class extension to local instance + misc 6.1+ compatibility. #23

Closed JordanPak closed 1 year ago

JordanPak commented 1 year ago

for PASE-1455

The Http mock is currently extending \Requests_Transport_cURL (which was deprecated and mapped to \WpOrg\Requests\Transport\Curl), a final class in WordPress 6.2. This removes that extension and creates a local prop with the instance of \WpOrg\Requests\Transport\Curl that methods/props can be used with.

This change has been tested with unit tests for the following in pmc-plugins:

  1. pmc-unit-test-example
  2. pmc-admantx
  3. pmc-footer
  4. pmc-store-products
  5. pmc-trackonomics
  6. pmc-facebook-instant-articles