Changeset 57526 for trunk/tests/phpunit/tests/block-bindings/register.php
- Timestamp:
- 02/02/2024 08:22:11 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/block-bindings/register.php
r57514 r57526 18 18 19 19 /** 20 * Set up before each test.21 *22 * @since 6.5.023 */24 public function set_up() {25 foreach ( get_all_registered_block_bindings_sources() as $source_name => $source_properties ) {26 unregister_block_bindings_source( $source_name );27 }28 29 parent::set_up();30 }31 32 /**33 20 * Tear down after each test. 34 21 * … … 37 24 public function tear_down() { 38 25 foreach ( get_all_registered_block_bindings_sources() as $source_name => $source_properties ) { 39 unregister_block_bindings_source( $source_name ); 26 if ( str_starts_with( $source_name, 'test/' ) ) { 27 unregister_block_bindings_source( $source_name ); 28 } 40 29 } 41 30 … … 50 39 * @covers ::register_block_bindings_source 51 40 * @covers ::get_all_registered_block_bindings_sources 41 * @covers ::get_block_bindings_source 52 42 */ 53 43 public function test_get_all_registered() { … … 65 55 66 56 $expected = array( 67 $source_one_name => array_merge( array( 'name' => $source_one_name ), $source_one_properties ), 68 $source_two_name => array_merge( array( 'name' => $source_two_name ), $source_two_properties ), 69 $source_three_name => array_merge( array( 'name' => $source_three_name ), $source_three_properties ), 57 $source_one_name => array_merge( array( 'name' => $source_one_name ), $source_one_properties ), 58 $source_two_name => array_merge( array( 'name' => $source_two_name ), $source_two_properties ), 59 $source_three_name => array_merge( array( 'name' => $source_three_name ), $source_three_properties ), 60 'core/post-meta' => get_block_bindings_source( 'core/post-meta' ), 61 'core/pattern-overrides' => get_block_bindings_source( 'core/pattern-overrides' ), 70 62 ); 71 63 72 64 $registered = get_all_registered_block_bindings_sources(); 73 $this->assert Same( $expected, $registered );65 $this->assertEquals( $expected, $registered ); 74 66 } 75 67
Note: See TracChangeset
for help on using the changeset viewer.