Changeset 52010 for trunk/tests/phpunit/tests/blocks/register.php
- Timestamp:
- 11/04/2021 03:22:47 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/blocks/register.php
r51657 r52010 51 51 * Empty render function for tests to use. 52 52 */ 53 function render_stub() {}53 public function render_stub() {} 54 54 55 55 /** … … 58 58 * @since 5.0.0 59 59 */ 60 function tear_down() {60 public function tear_down() { 61 61 $registry = WP_Block_Type_Registry::get_instance(); 62 62 … … 75 75 * @return string 76 76 */ 77 function filter_set_locale_to_polish() {77 public function filter_set_locale_to_polish() { 78 78 return 'pl_PL'; 79 79 } … … 82 82 * @ticket 45109 83 83 */ 84 function test_register_affects_main_registry() {84 public function test_register_affects_main_registry() { 85 85 $name = 'core/test-static'; 86 86 $settings = array( … … 97 97 * @ticket 45109 98 98 */ 99 function test_unregister_affects_main_registry() {99 public function test_unregister_affects_main_registry() { 100 100 $name = 'core/test-static'; 101 101 $settings = array( … … 113 113 * @ticket 50263 114 114 */ 115 function test_does_not_remove_block_asset_path_prefix() {115 public function test_does_not_remove_block_asset_path_prefix() { 116 116 $result = remove_block_asset_path_prefix( 'script-handle' ); 117 117 … … 122 122 * @ticket 50263 123 123 */ 124 function test_removes_block_asset_path_prefix() {124 public function test_removes_block_asset_path_prefix() { 125 125 $result = remove_block_asset_path_prefix( 'file:./block.js' ); 126 126 … … 131 131 * @ticket 50263 132 132 */ 133 function test_generate_block_asset_handle() {133 public function test_generate_block_asset_handle() { 134 134 $block_name = 'unit-tests/my-block'; 135 135 … … 159 159 * @ticket 50328 160 160 */ 161 function test_generate_block_asset_handle_core_block() {161 public function test_generate_block_asset_handle_core_block() { 162 162 $block_name = 'core/paragraph'; 163 163 … … 187 187 * @ticket 50263 188 188 */ 189 function test_field_not_found_register_block_script_handle() {189 public function test_field_not_found_register_block_script_handle() { 190 190 $result = register_block_script_handle( array(), 'script' ); 191 191 … … 196 196 * @ticket 50263 197 197 */ 198 function test_empty_value_register_block_script_handle() {198 public function test_empty_value_register_block_script_handle() { 199 199 $metadata = array( 'script' => '' ); 200 200 $result = register_block_script_handle( $metadata, 'script' ); … … 207 207 * @ticket 50263 208 208 */ 209 function test_missing_asset_file_register_block_script_handle() {209 public function test_missing_asset_file_register_block_script_handle() { 210 210 $metadata = array( 211 211 'file' => __FILE__, … … 221 221 * @ticket 50263 222 222 */ 223 function test_handle_passed_register_block_script_handle() {223 public function test_handle_passed_register_block_script_handle() { 224 224 $metadata = array( 225 225 'editorScript' => 'test-script-handle', … … 233 233 * @ticket 50263 234 234 */ 235 function test_success_register_block_script_handle() {235 public function test_success_register_block_script_handle() { 236 236 $metadata = array( 237 237 'file' => DIR_TESTDATA . '/blocks/notice/block.json', … … 247 247 * @ticket 50263 248 248 */ 249 function test_field_not_found_register_block_style_handle() {249 public function test_field_not_found_register_block_style_handle() { 250 250 $result = register_block_style_handle( array(), 'style' ); 251 251 … … 256 256 * @ticket 50263 257 257 */ 258 function test_empty_value_found_register_block_style_handle() {258 public function test_empty_value_found_register_block_style_handle() { 259 259 $metadata = array( 'style' => '' ); 260 260 $result = register_block_style_handle( $metadata, 'style' ); … … 266 266 * @ticket 50263 267 267 */ 268 function test_handle_passed_register_block_style_handle() {268 public function test_handle_passed_register_block_style_handle() { 269 269 $metadata = array( 270 270 'style' => 'test-style-handle', … … 279 279 * @ticket 50328 280 280 */ 281 function test_success_register_block_style_handle() {281 public function test_success_register_block_style_handle() { 282 282 $metadata = array( 283 283 'file' => DIR_TESTDATA . '/blocks/notice/block.json', … … 303 303 * @ticket 50263 304 304 */ 305 function test_metadata_not_found_in_wordpress_core() {305 public function test_metadata_not_found_in_wordpress_core() { 306 306 $result = register_block_type_from_metadata( 'unknown' ); 307 307 … … 315 315 * @ticket 50263 316 316 */ 317 function test_metadata_not_found_in_the_current_directory() {317 public function test_metadata_not_found_in_the_current_directory() { 318 318 $result = register_block_type_from_metadata( __DIR__ ); 319 319 … … 328 328 * @ticket 50328 329 329 */ 330 function test_block_registers_with_metadata_fixture() {330 public function test_block_registers_with_metadata_fixture() { 331 331 $result = register_block_type_from_metadata( 332 332 DIR_TESTDATA . '/blocks/notice' … … 415 415 * @ticket 53233 416 416 */ 417 function test_block_register_block_type_proxy_for_metadata() {417 public function test_block_register_block_type_proxy_for_metadata() { 418 418 $result = register_block_type( 419 419 DIR_TESTDATA . '/blocks/notice' … … 427 427 * @ticket 52301 428 428 */ 429 function test_block_registers_with_metadata_i18n_support() {429 public function test_block_registers_with_metadata_i18n_support() { 430 430 add_filter( 'locale', array( $this, 'filter_set_locale_to_polish' ) ); 431 431 load_textdomain( 'notice', WP_LANG_DIR . '/plugins/notice-pl_PL.mo' ); … … 473 473 * @ticket 45109 474 474 */ 475 function test_get_dynamic_block_names() {475 public function test_get_dynamic_block_names() { 476 476 register_block_type( 'core/test-static', array() ); 477 477 register_block_type( 'core/test-dynamic', array( 'render_callback' => array( $this, 'render_stub' ) ) ); … … 486 486 * @ticket 45109 487 487 */ 488 function test_has_blocks() {488 public function test_has_blocks() { 489 489 // Test with passing post ID. 490 490 $this->assertTrue( has_blocks( self::$post_id ) );
Note: See TracChangeset
for help on using the changeset viewer.