- Timestamp:
- 02/26/2025 07:38:08 PM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/blocks/wpBlockMetadataRegistry.php
r59730 r59874 5 5 * 6 6 * @group blocks 7 * @coversDefaultClass WP_Block_Metadata_Registry 7 8 */ 8 9 class Tests_Blocks_WpBlockMetadataRegistry extends WP_UnitTestCase { … … 189 190 $this->assertFalse( $result, 'Non-existent manifest should not be registered' ); 190 191 } 192 193 /** 194 * Tests that the `get_collection_block_metadata_files()` method returns the expected list of block metadata files. 195 * 196 * @ticket 62267 197 * @covers ::get_collection_block_metadata_files 198 */ 199 public function test_get_collection_block_metadata_files() { 200 $path = WP_PLUGIN_DIR . '/test-plugin/data/block-types'; 201 $manifest_data = array( 202 'a-block' => array( 203 'name' => 'a-block', 204 'title' => 'A Block', 205 ), 206 'another-block' => array( 207 'name' => 'another-block', 208 'title' => 'Another Block', 209 ), 210 ); 211 212 file_put_contents( $this->temp_manifest_file, '<?php return ' . var_export( $manifest_data, true ) . ';' ); 213 214 $this->assertTrue( WP_Block_Metadata_Registry::register_collection( $path, $this->temp_manifest_file ) ); 215 $this->assertSame( 216 array( 217 WP_PLUGIN_DIR . '/test-plugin/data/block-types/a-block/block.json', 218 WP_PLUGIN_DIR . '/test-plugin/data/block-types/another-block/block.json', 219 ), 220 WP_Block_Metadata_Registry::get_collection_block_metadata_files( $path ) 221 ); 222 } 191 223 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)