Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/13/2022 08:58:51 AM (21 months 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/includes/testcase-emails.php

    r10539 r13314  
    44class BP_UnitTestCase_Emails extends BP_UnitTestCase {
    55
    6     public static function setUpBeforeClass() {
    7         parent::setUpBeforeClass();
     6    public static function set_up_before_class() {
     7        parent::set_up_before_class();
    88
    99        require_once( buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' );
     
    1616    }
    1717
    18     public static function tearDownAfterClass() {
     18    public static function tear_down_after_class() {
    1919        $emails = get_posts( array(
    2020            'fields'           => 'ids',
     
    3131        }
    3232
    33         parent::tearDownAfterClass();
     33        parent::tear_down_after_class();
    3434    }
    3535}
Note: See TracChangeset for help on using the changeset viewer.