diff --git a/tests/phpunit/tests/option/option.php b/tests/phpunit/tests/option/option.php index 656fe086a9..d510528e07 100644 --- a/tests/phpunit/tests/option/option.php +++ b/tests/phpunit/tests/option/option.php @@ -45,7 +45,7 @@ class Tests_Option_Option extends WP_UnitTestCase { * @covers ::add_option * @covers ::delete_option */ - public function test_default_filter() { + public function test_default_option_filter() { $value = 'value'; $this->assertFalse( get_option( 'doesnotexist' ) ); @@ -85,6 +85,21 @@ class Tests_Option_Option extends WP_UnitTestCase { $this->assertSame( 'bar', get_option( 'doesnotexist' ) ); } + /** + * @ticket 37930 + * + * @covers ::get_option + */ + public function test_get_option_should_call_pre_option_filter() { + $filter = new MockAction(); + + add_filter( 'pre_option', array( $filter, 'filter' ) ); + + get_option( 'ignored' ); + + $this->assertSame( 1, $filter->get_call_count() ); + } + /** * @covers ::get_option * @covers ::add_option @@ -297,19 +312,4 @@ class Tests_Option_Option extends WP_UnitTestCase { array( 'autoload_false', false, 'no' ), ); } - - /** - * @ticket 37930 - * - * @covers ::get_option - */ - public function test_filter_pre_option_all_filter_is_called() { - $filter = new MockAction(); - - add_filter( 'pre_option', array( $filter, 'filter' ) ); - - get_option( 'ignored' ); - - $this->assertSame( 1, $filter->get_call_count() ); - } }