mirror of
https://github.com/buddypress/buddypress.git
synced 2026-07-23 21:06:56 +08:00
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 git-svn-id: https://buddypress.svn.wordpress.org/trunk@13314 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
32 lines
788 B
PHP
32 lines
788 B
PHP
<?php
|
|
|
|
/**
|
|
* @group members
|
|
*/
|
|
class BP_Tests_Members_Template_BpGetMemberClass extends BP_UnitTestCase {
|
|
/**
|
|
* @ticket BP6996
|
|
*/
|
|
public function test_should_contain_member_type_classes() {
|
|
buddypress()->members->types = array();
|
|
bp_register_member_type( 'foo' );
|
|
bp_register_member_type( 'bar' );
|
|
|
|
$u = self::factory()->user->create();
|
|
bp_set_member_type( $u, 'bar' );
|
|
|
|
if ( bp_has_members( array( 'include' => array( $u ) ) ) ) {
|
|
while ( bp_members() ) {
|
|
bp_the_member();
|
|
$found = bp_get_member_class();
|
|
}
|
|
}
|
|
|
|
global $members_template;
|
|
unset( $members_template );
|
|
buddypress()->members->types = array();
|
|
|
|
$this->assertStringContainsString( 'member-type-bar', $found );
|
|
$this->assertStringNotContainsString( 'member-type-foo', $found );
|
|
}
|
|
}
|