Skip to content

Commit 63e70d4

Browse files
committed
Tests: Update assertion for auto-detection in dependencies test
With auto-detection, print_script_module_translations() iterates every enqueued module and its dependencies, so the load_script_textdomain_relative_path filter now fires for both the main module and its dependency rather than only for the dependency that had set_translations() called on it.
1 parent 1eaaa51 commit 63e70d4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/phpunit/tests/script-modules/wpScriptModules.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2800,7 +2800,8 @@ static function ( $relative, $src, $is_module ) use ( &$filtered ) {
28002800

28012801
$output = get_echo( array( $this->script_modules, 'print_script_module_translations' ) );
28022802

2803-
$this->assertCount( 1, $filtered );
2803+
// With auto-detection, the filter fires for every enqueued module and its dependencies.
2804+
$this->assertCount( 2, $filtered );
28042805
foreach ( $filtered as $filter_args ) {
28052806
$this->assertIsString( $filter_args['relative'] );
28062807
$this->assertIsString( $filter_args['src'] );

0 commit comments

Comments
 (0)