Skip to content

Commit 9672f54

Browse files
committed
Customize: Use static closures in tests to reduce memory usage.
Follow-up to [60499]. Props mukesh27. See #63632. git-svn-id: https://develop.svn.wordpress.org/trunk@60500 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 7ee5af1 commit 9672f54

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/phpunit/tests/theme/wpTheme.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ public function test_wp_customize_url_with_existing_query_args() {
410410
// Ensure the existing query arg is present in the URL.
411411
add_filter(
412412
'admin_url',
413-
function ( $url ) {
413+
static function ( $url ) {
414414
return add_query_arg( 'existing_arg', 'value', $url );
415415
}
416416
);
@@ -430,7 +430,7 @@ public function test_wp_customize_url_with_existing_theme_query_arg() {
430430
// Ensure the theme query arg is replaced with the new value.
431431
add_filter(
432432
'admin_url',
433-
function ( $url ) {
433+
static function ( $url ) {
434434
return add_query_arg( 'theme', 'to-be-replaced', $url );
435435
}
436436
);
@@ -450,7 +450,7 @@ public function test_wp_customize_url_with_multiple_theme_query_args() {
450450
// Ensure the theme query arg is replaced with the new value.
451451
add_filter(
452452
'admin_url',
453-
function ( $url ) {
453+
static function ( $url ) {
454454
return add_query_arg( array( 'theme' => array( 'to-be-replaced-1', 'to-be-replaced-2' ) ), $url );
455455
}
456456
);

0 commit comments

Comments
 (0)