Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/13/2022 08:58:51 AM (3 years ago)
Author:
imath
Message:

Fully enjoy Yoast’s PHPUnit polyfills

Using these polyfills let us use PHPUnit v9.x for our tests and add PHP 8.1 to our testing matrix. Some additional edits to our PHP unit tests suite were needed:

  • Stop using PHPunit deprecated functions.
  • Rename some BP_UnitTestCase methods to use Yoast's polyfills.
  • Edit the PHP Unit test GH action and also run this action on pull requests.
  • Update some composer dependencies, remove the one about phpunit/phpunit:^7.5 and add a new composer script to use PHPUnit v9.x.

Props renatonascalves, rafiahmedd

Closes https://github.com/buddypress/buddypress/pull/13
Fixes #8649

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/core/class-bp-attachment.php

    r13175 r13314  
    1111    private $image_file;
    1212
    13     public function setUp() {
    14         parent::setUp();
     13    public function set_up() {
     14        parent::set_up();
    1515        add_filter( 'bp_attachment_upload_overrides',        array( $this, 'filter_overrides' ),       10, 1 );
    1616        add_filter( 'upload_dir',                            array( $this, 'filter_upload_dir' ),      20, 1 );
     
    2121    }
    2222
    23     public function tearDown() {
    24         parent::tearDown();
     23    public function tear_down() {
     24        parent::tear_down();
    2525        remove_filter( 'bp_attachment_upload_overrides',     array( $this, 'filter_overrides' ),       10 );
    2626        remove_filter( 'upload_dir',                         array( $this, 'filter_upload_dir' ),      20 );
Note: See TracChangeset for help on using the changeset viewer.