Make WordPress Core

Changeset 58160

Timestamp:
05/16/2024 03:13:43 PM (2 months ago)
Author:
SergeyBiryukov
Message:

Tests: Use assertSame() in block_has_support() tests.

This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using assertSame() should generally be preferred to assertEquals() where appropriate, to make the tests more reliable.

Follow-up to [56382].

See #60706.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/blocks/wpBlock.php

    r57068 r58160  
    698698        $block_type  = $this->registry->get_registered( 'core/example' );
    699699        $has_support = block_has_support( $block_type, $support );
    700         $this->assertEquals( $expected, $has_support, $message );
     700        $this->assert( $expected, $has_support, $message );
    701701    }
    702702
Note: See TracChangeset for help on using the changeset viewer.