- Timestamp:
- 08/29/2024 06:04:02 AM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/script-modules/wpScriptModules.php
r58579 r58952 699 699 $this->assertCount( 1, $import_map ); 700 700 $this->assertStringStartsWith( '/dep.js', $import_map['dep'] ); 701 }702 703 /**704 * @ticket 60348705 *706 * @covers ::print_import_map_polyfill()707 */708 public function test_wp_print_import_map_has_no_polyfill_when_no_modules_registered() {709 $import_map_polyfill = get_echo( array( $this->script_modules, 'print_import_map' ) );710 711 $this->assertSame( '', $import_map_polyfill );712 }713 714 /**715 * @ticket 60348716 *717 * @covers ::print_import_map_polyfill()718 */719 public function test_wp_print_import_map_has_polyfill_when_modules_registered() {720 $script_name = 'wp-polyfill-importmap';721 wp_register_script( $script_name, '/wp-polyfill-importmap.js' );722 723 $this->script_modules->enqueue( 'foo', '/foo.js', array( 'dep' ), '1.0' );724 $this->script_modules->register( 'dep', '/dep.js' );725 $import_map_polyfill = get_echo( array( $this->script_modules, 'print_import_map' ) );726 727 wp_deregister_script( $script_name );728 729 $p = new WP_HTML_Tag_Processor( $import_map_polyfill );730 $p->next_tag( array( 'tag' => 'SCRIPT' ) );731 $id = $p->get_attribute( 'id' );732 733 $this->assertSame( 'wp-load-polyfill-importmap', $id );734 701 } 735 702
Note: See TracChangeset
for help on using the changeset viewer.