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/core/avatars.php

    r12760 r13314  
    328328        ) );
    329329
    330         $this->assertContains( 'mystery-man-50.jpg', $found );
     330        $this->assertStringContainsString( 'mystery-man-50.jpg', $found );
    331331    }
    332332
     
    344344        ) );
    345345
    346         $this->assertContains( 'mystery-man-50.jpg', $found );
     346        $this->assertStringContainsString( 'mystery-man-50.jpg', $found );
    347347    }
    348348
     
    361361        remove_filter( 'bp_core_avatar_thumb_width', array( $this, 'filter_thumb_width' ) );
    362362
    363         $this->assertContains( 'mystery-man.jpg', $found );
     363        $this->assertStringContainsString( 'mystery-man.jpg', $found );
    364364    }
    365365
Note: See TracChangeset for help on using the changeset viewer.