Skip to content

Commit

Permalink
Check pre_ filter
Browse files Browse the repository at this point in the history
  • Loading branch information
mukeshpanchal27 authored Oct 9, 2023
1 parent 3770c8c commit a121804
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/phpunit/tests/option/networkOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ public function test_update_network_option_should_add_option_with_filtered_defau
$default_value = 'default-value';

add_filter(
"default_site_option_{$option}",
"pre_site_option_{$option}",
static function () use ( $default_value ) {
return $default_value;
}
Expand Down Expand Up @@ -769,7 +769,7 @@ public function test_update_network_option_with_pre_filter_updates_option_with_d
add_option( null, 'foo', 1 );

// Force a return value of integer 0.
add_filter( 'default_site_option_foo', '__return_zero' );
add_filter( 'pre_site_option_foo', '__return_zero' );

/*
* This should succeed, since the 'foo' option has a value of 1 in the database.
Expand All @@ -790,6 +790,6 @@ public function test_update_network_option_maintains_pre_filters() {
update_network_option( null, 'foo', 0 );

// Assert that the filter is still present.
$this->assertSame( 10, has_filter( 'default_site_option_foo', '__return_zero' ) );
$this->assertSame( 10, has_filter( 'pre_site_option_foo', '__return_zero' ) );
}
}

0 comments on commit a121804

Please sign in to comment.