Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/20/2026 01:39:38 PM (7 weeks ago)
Author:
espellcaste
Message:

Tests: Replace assertEquals() with assertSame().

Use type-strict assertions in the test suite. This ensures that not only the return values match the expected results, but also that their type is the same.

Also, normalize affected numeric API return types where appropriate for type safety reasons.

Fixes #9342.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/members/types.php

    r13336 r14286  
    139139
    140140        public function test_bp_get_member_type_object_should_return_null_for_non_existent_member_type() {
    141                 $this->assertSame( null, bp_get_member_type_object( 'foo' ) );
     141                $this->assertNull( bp_get_member_type_object( 'foo' ) );
    142142        }
    143143
    … …  
    326326                $this->assertFalse( bp_remove_member_type( $u1, 'foo' ) );
    327327                $types = bp_get_member_type( $u1, false );
    328                 $this->assertEquals( array( 'bar' ), $types );
     328                $this->assertSame( array( 'bar' ), $types );
    329329        }
    330330
    … …  
    341341                $this->assertTrue( bp_remove_member_type( $u1, 'foo' ) );
    342342                $types = bp_get_member_type( $u1, false );
    343                 $this->assertEquals( array( 'bar' ), $types );
     343                $this->assertSame( array( 'bar' ), $types );
    344344        }
    345345
    … …  
    413413
    414414                $type = bp_get_member_type( $u1, false, false );
    415                 $this->assertEquals( array( 'foo' ), $type );
     415                $this->assertSame( array( 'foo' ), $type );
    416416        }
    417417}
Note: See TracChangeset for help on using the changeset viewer.