- Timestamp:
- 01/28/2026 09:28:06 PM (6 months ago)
- Location:
- branches/6.9
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
tests/phpunit/tests/script-modules/wpScriptModules.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/6.9
- Property svn:mergeinfo changed
/trunk merged: 61323,61357,61542
- Property svn:mergeinfo changed
-
branches/6.9/tests/phpunit/tests/script-modules/wpScriptModules.php
r61536 r61550 2107 2107 ); 2108 2108 2109 $deregister( array( 'b', 'c ' ) );2109 $deregister( array( 'b', 'c' ) ); 2110 2110 2111 2111 // Test that registered dependency in footer doesn't place dependant in footer. … … 2356 2356 ); 2357 2357 } 2358 2359 /** 2360 * Tests that a missing script module dependency triggers a _doing_it_wrong() notice. 2361 * 2362 * @ticket 64229 2363 * @covers WP_Script_Modules::sort_item_dependencies 2364 */ 2365 public function test_missing_script_module_dependency_triggers_incorrect_usage() { 2366 $expected_incorrect_usage = 'WP_Script_Modules::register'; 2367 $this->setExpectedIncorrectUsage( $expected_incorrect_usage ); 2368 2369 $this->script_modules->enqueue( 'main-module', '/main-module.js', array( 'missing-mod-dep' ) ); 2370 2371 $markup = get_echo( array( $this->script_modules, 'print_enqueued_script_modules' ) ); 2372 $this->assertStringNotContainsString( 'main-module.js', $markup, 'Expected script module to be absent.' ); 2373 2374 $this->assertArrayHasKey( 2375 $expected_incorrect_usage, 2376 $this->caught_doing_it_wrong, 2377 'Expected WP_Script_Modules::register to be reported via doing_it_wrong().' 2378 ); 2379 2380 // Assert the message mentions the missing dependency handle. 2381 $this->assertStringContainsString( 2382 'The script module with the ID "main-module" was enqueued with dependencies that are not registered: missing-mod-dep', 2383 $this->caught_doing_it_wrong[ $expected_incorrect_usage ] 2384 ); 2385 } 2358 2386 }
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)