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/testcases/groups/functions/bpGetUserGroups.php

    r12433 r13314  
    99    static $groups;
    1010
    11     public function setUp() {
    12         parent::setUp();
     11    public function set_up() {
     12        parent::set_up();
    1313        groups_remove_member( self::$user, self::$groups[2] );
    1414    }
     
    4141    }
    4242
    43     public static function tearDownAfterClass() {
     43    public static function tear_down_after_class() {
    4444        foreach ( self::$groups as $group ) {
    4545            groups_delete_group( $group );
     
    6363
    6464        foreach ( $found as $index => $f ) {
    65             $this->assertInternalType( 'int', $index );
    66             $this->assertInternalType( 'object', $f );
    67             $this->assertInternalType( 'int', $f->group_id );
     65            $this->assertIsInt( $index );
     66            $this->assertIsObject( $f );
     67            $this->assertIsInt( $f->group_id );
    6868            $this->assertSame( $index, $f->group_id );
    6969        }
Note: See TracChangeset for help on using the changeset viewer.