Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/13/2022 08:58:51 AM (2 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/members/template/bpGetMemberTypeDirectoryPermalink.php

    r10459 r13314  
    66 */
    77class BP_Tests_Members_Template_BpGetMemberTypeDirectoryPermalink extends BP_UnitTestCase {
    8     public function setUp() {
    9         parent::setUp();
     8    public function set_up() {
     9        parent::set_up();
    1010
    1111        buddypress()->members->types = array();
     
    2424        remove_filter( 'bp_get_current_member_type', array( $this, 'fake_current_member_type' ) );
    2525
    26         $this->assertContains( '/type/foo/', $found );
     26        $this->assertStringContainsString( '/type/foo/', $found );
    2727    }
    2828
     
    4242        remove_filter( 'bp_get_current_member_type', array( $this, 'fake_current_member_type' ) );
    4343
    44         $this->assertContains( '/type/bar/', $found );
     44        $this->assertStringContainsString( '/type/bar/', $found );
    4545    }
    4646
Note: See TracChangeset for help on using the changeset viewer.