From 9e764b2a98876fb6191cca4bb46bc68ce8603c27 Mon Sep 17 00:00:00 2001 From: rxu Date: Tue, 16 Sep 2025 22:35:55 +0700 Subject: [PATCH] [ticket/17543] Remove ReflectionProperty::setAccessible() method calls As of PHP 8.1.0, calling this method has no effect; all properties are accessible by default. The method is deprecated since PHP 8.5. PHPBB-17543 --- tests/avatar/driver_gravatar_test.php | 2 -- tests/ban/ban_manager_test.php | 1 - tests/cache/file_driver_test.php | 16 ---------------- tests/captcha/turnstile_test.php | 7 ------- tests/datetime/from_format_test.php | 2 -- tests/dbal/db_tools_test.php | 1 - tests/email/email_parsing_test.php | 1 - tests/extension/extension_base_test.php | 1 - tests/files/types_local_test.php | 1 - tests/files/upload_test.php | 1 - tests/filesystem/helper_realpath_test.php | 1 - tests/filesystem/realpath_test.php | 1 - tests/group/helper_test_case.php | 2 -- tests/language/language_test.php | 2 -- tests/messenger/queue_test.php | 2 -- tests/migrator/get_callable_from_step_test.php | 1 - .../notification_method_email_test.php | 1 - .../notification_method_webpush_test.php | 1 - tests/template/extension_test.php | 1 - tests/template/template_test_case.php | 1 - tests/template/twig_test.php | 1 - tests/text_reparser/plugins/post_text_test.php | 1 - .../plugins/test_row_based_plugin.php | 1 - tests/ucp/controller_webpush_test.php | 2 -- tests/upload/filespec_test.php | 2 -- 25 files changed, 53 deletions(-) diff --git a/tests/avatar/driver_gravatar_test.php b/tests/avatar/driver_gravatar_test.php index 026655e11a..bc84f35610 100644 --- a/tests/avatar/driver_gravatar_test.php +++ b/tests/avatar/driver_gravatar_test.php @@ -166,13 +166,11 @@ class phpbb_avatar_driver_gravatar_test extends \phpbb_database_test_case ->willReturn([]); $requestInputReflection = new \ReflectionProperty($request, 'input'); - $requestInputReflection->setAccessible(true); $request_data[request_interface::GET] = $request_data[request_interface::GET] ?? []; $request_data[request_interface::POST] = $request_data[request_interface::POST] ?? []; $request_data[request_interface::REQUEST] = $request_data[request_interface::GET] + $request_data[request_interface::POST]; $requestInputReflection->setValue($request, $request_data); $requestTypeCastHelperReflection = new \ReflectionProperty($request, 'type_cast_helper'); - $requestTypeCastHelperReflection->setAccessible(true); $requestTypeCastHelperReflection->setValue($request, new \phpbb\request\type_cast_helper()); $this->gravatar->prepare_form($request, $this->template, $this->user, $row, $error); diff --git a/tests/ban/ban_manager_test.php b/tests/ban/ban_manager_test.php index cdc64435b5..34a0acdaa3 100644 --- a/tests/ban/ban_manager_test.php +++ b/tests/ban/ban_manager_test.php @@ -411,7 +411,6 @@ class ban_manager_test extends \phpbb_session_test_case $ban_type_ip_reflection = new \ReflectionClass($ban_type_ip); $get_excluded_reflection = $ban_type_ip_reflection->getMethod('get_excluded'); - $get_excluded_reflection->setAccessible(true); $this->assertFalse($get_excluded_reflection->invoke($ban_type_ip)); } diff --git a/tests/cache/file_driver_test.php b/tests/cache/file_driver_test.php index c8fe44be74..f615cea3b0 100644 --- a/tests/cache/file_driver_test.php +++ b/tests/cache/file_driver_test.php @@ -68,7 +68,6 @@ class phpbb_cache_file_driver_test extends phpbb_cache_common_test_case $filename = "{$this->cache_dir}unreadable.$phpEx"; @chmod($filename, 0000); $readReflection = new \ReflectionMethod($this->cache_file, '_read'); - $readReflection->setAccessible(true); $this->assertFalse($readReflection->invoke($this->cache_file, 'unreadable')); @chmod($filename, 0600); $this->assertNotFalse($readReflection->invoke($this->cache_file, 'unreadable')); @@ -79,11 +78,9 @@ class phpbb_cache_file_driver_test extends phpbb_cache_common_test_case global $phpEx; $reflectionCacheVars = new \ReflectionProperty($this->cache_file, 'vars'); - $reflectionCacheVars->setAccessible(true); $reflectionCacheVars->setValue($this->cache_file, ['foo' => 'bar']); $reflectionCacheVarExpires = new \ReflectionProperty($this->cache_file, 'var_expires'); - $reflectionCacheVarExpires->setAccessible(true); $reflectionCacheVarExpires->setValue($this->cache_file, ['foo' => time() + 86400]); // Create file in invalid format @@ -95,7 +92,6 @@ class phpbb_cache_file_driver_test extends phpbb_cache_common_test_case file_put_contents($filename, $cache_data); $readReflection = new \ReflectionMethod($this->cache_file, '_read'); - $readReflection->setAccessible(true); $this->assertFalse($readReflection->invoke($this->cache_file, 'data_global')); } @@ -104,11 +100,9 @@ class phpbb_cache_file_driver_test extends phpbb_cache_common_test_case global $phpEx; $reflectionCacheVars = new \ReflectionProperty($this->cache_file, 'vars'); - $reflectionCacheVars->setAccessible(true); $reflectionCacheVars->setValue($this->cache_file, ['foo' => 'bar']); $reflectionCacheVarExpires = new \ReflectionProperty($this->cache_file, 'var_expires'); - $reflectionCacheVarExpires->setAccessible(true); $reflectionCacheVarExpires->setValue($this->cache_file, ['foo' => time() + 86400]); // Create file in invalid format @@ -120,7 +114,6 @@ class phpbb_cache_file_driver_test extends phpbb_cache_common_test_case file_put_contents($filename, $cache_data); $readReflection = new \ReflectionMethod($this->cache_file, '_read'); - $readReflection->setAccessible(true); $this->assertFalse($readReflection->invoke($this->cache_file, 'data_global')); } @@ -129,11 +122,9 @@ class phpbb_cache_file_driver_test extends phpbb_cache_common_test_case global $phpEx; $reflectionCacheVars = new \ReflectionProperty($this->cache_file, 'vars'); - $reflectionCacheVars->setAccessible(true); $reflectionCacheVars->setValue($this->cache_file, ['foo' => 'bar']); $reflectionCacheVarExpires = new \ReflectionProperty($this->cache_file, 'var_expires'); - $reflectionCacheVarExpires->setAccessible(true); $reflectionCacheVarExpires->setValue($this->cache_file, ['foo' => time() + 86400]); // Create file in invalid format @@ -145,18 +136,15 @@ class phpbb_cache_file_driver_test extends phpbb_cache_common_test_case file_put_contents($filename, $cache_data); $readReflection = new \ReflectionMethod($this->cache_file, '_read'); - $readReflection->setAccessible(true); $this->assertFalse($readReflection->invoke($this->cache_file, 'data_global')); } public function test_read_data_global_expired() { $reflectionCacheVars = new \ReflectionProperty($this->cache_file, 'vars'); - $reflectionCacheVars->setAccessible(true); $reflectionCacheVars->setValue($this->cache_file, ['foo' => 'bar']); $reflectionCacheVarExpires = new \ReflectionProperty($this->cache_file, 'var_expires'); - $reflectionCacheVarExpires->setAccessible(true); $reflectionCacheVarExpires->setValue($this->cache_file, ['foo' => time() - 86400]); // Create file in invalid format @@ -167,7 +155,6 @@ class phpbb_cache_file_driver_test extends phpbb_cache_common_test_case $reflectionCacheVarExpires->setValue($this->cache_file, []); $readReflection = new \ReflectionMethod($this->cache_file, '_read'); - $readReflection->setAccessible(true); $this->assertTrue($readReflection->invoke($this->cache_file, 'data_global')); // Check data, should be empty @@ -177,12 +164,10 @@ class phpbb_cache_file_driver_test extends phpbb_cache_common_test_case public function test_read_data_global() { $reflectionCacheVars = new \ReflectionProperty($this->cache_file, 'vars'); - $reflectionCacheVars->setAccessible(true); $expectedVars = ['foo' => 'bar']; $reflectionCacheVars->setValue($this->cache_file, $expectedVars); $reflectionCacheVarExpires = new \ReflectionProperty($this->cache_file, 'var_expires'); - $reflectionCacheVarExpires->setAccessible(true); $expectedVarExpires = ['foo' => time() + 86400]; $reflectionCacheVarExpires->setValue($this->cache_file, $expectedVarExpires); @@ -196,7 +181,6 @@ class phpbb_cache_file_driver_test extends phpbb_cache_common_test_case $this->assertEquals([], $reflectionCacheVarExpires->getValue($this->cache_file)); $readReflection = new \ReflectionMethod($this->cache_file, '_read'); - $readReflection->setAccessible(true); $this->assertTrue($readReflection->invoke($this->cache_file, 'data_global')); // Check data, should be empty diff --git a/tests/captcha/turnstile_test.php b/tests/captcha/turnstile_test.php index 8d3c995810..c95e3225d2 100644 --- a/tests/captcha/turnstile_test.php +++ b/tests/captcha/turnstile_test.php @@ -244,7 +244,6 @@ class phpbb_captcha_turnstile_test extends \phpbb_database_test_case { $this->turnstile->set_name('custom_service'); $service_name_property = new \ReflectionProperty($this->turnstile, 'service_name'); - $service_name_property->setAccessible(true); $this->assertEquals('custom_service', $service_name_property->getValue($this->turnstile)); } @@ -275,7 +274,6 @@ class phpbb_captcha_turnstile_test extends \phpbb_database_test_case // Use reflection to inject the mocked client into the turnstile class $reflection = new \ReflectionClass($this->turnstile); $client_property = $reflection->getProperty('client'); - $client_property->setAccessible(true); $client_property->setValue($this->turnstile, $client_mock); // Validate that the CAPTCHA was solved successfully @@ -301,7 +299,6 @@ class phpbb_captcha_turnstile_test extends \phpbb_database_test_case // Use reflection to inject the mocked client into the turnstile class $reflection = new \ReflectionClass($this->turnstile); $client_property = $reflection->getProperty('client'); - $client_property->setAccessible(true); $client_property->setValue($this->turnstile, $client_mock); // Validatation fails due to guzzle exception @@ -333,9 +330,7 @@ class phpbb_captcha_turnstile_test extends \phpbb_database_test_case { $turnstile_reflection = new \ReflectionClass($this->turnstile); $get_client_method = $turnstile_reflection->getMethod('get_client'); - $get_client_method->setAccessible(true); $client_property = $turnstile_reflection->getProperty('client'); - $client_property->setAccessible(true); $this->assertFalse($client_property->isInitialized($this->turnstile)); $client = $get_client_method->invoke($this->turnstile); @@ -363,7 +358,6 @@ class phpbb_captcha_turnstile_test extends \phpbb_database_test_case // Use reflection to inject the mocked client into the turnstile class $reflection = new \ReflectionClass($this->turnstile); $client_property = $reflection->getProperty('client'); - $client_property->setAccessible(true); $client_property->setValue($this->turnstile, $client_mock); // Validate that the CAPTCHA was not solved @@ -374,7 +368,6 @@ class phpbb_captcha_turnstile_test extends \phpbb_database_test_case { // Mock is_solved to return false $is_solved_property = new \ReflectionProperty($this->turnstile, 'solved'); - $is_solved_property->setAccessible(true); $is_solved_property->setValue($this->turnstile, false); // Mock the template assignments diff --git a/tests/datetime/from_format_test.php b/tests/datetime/from_format_test.php index 7c76da32d3..8b4b39eb90 100644 --- a/tests/datetime/from_format_test.php +++ b/tests/datetime/from_format_test.php @@ -32,11 +32,9 @@ class phpbb_datetime_from_format_test extends phpbb_test_case $reflection_class = new ReflectionClass('\phpbb\language\language'); // Set default language files loaded flag to true $common_language_files_loaded_flag = $reflection_class->getProperty('common_language_files_loaded'); - $common_language_files_loaded_flag->setAccessible(true); $common_language_files_loaded_flag->setValue($this->lang, true); // Set up test language data $lang_array = $reflection_class->getProperty('lang'); - $lang_array->setAccessible(true); $lang_array->setValue($this->lang, [ 'datetime' => [ 'TODAY' => 'Today', diff --git a/tests/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php index f6c108cdae..90fa0eca09 100644 --- a/tests/dbal/db_tools_test.php +++ b/tests/dbal/db_tools_test.php @@ -509,7 +509,6 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case if ($this->tools instanceof \phpbb\db\tools\mssql) { $max_length_method = new ReflectionMethod('\phpbb\db\tools\mssql', 'get_max_index_name_length'); - $max_length_method->setAccessible(true); $max_index_length = $max_length_method->invoke($this->tools); } diff --git a/tests/email/email_parsing_test.php b/tests/email/email_parsing_test.php index 574babea81..10447f363b 100644 --- a/tests/email/email_parsing_test.php +++ b/tests/email/email_parsing_test.php @@ -146,7 +146,6 @@ class phpbb_email_parsing_test extends phpbb_test_case $reflection = new ReflectionObject($this->email); $this->reflection_template_property = $reflection->getProperty('template'); - $this->reflection_template_property->setAccessible(true); } public static function email_parsing_data() diff --git a/tests/extension/extension_base_test.php b/tests/extension/extension_base_test.php index 7dc8c1a45c..e0d34fee81 100644 --- a/tests/extension/extension_base_test.php +++ b/tests/extension/extension_base_test.php @@ -27,7 +27,6 @@ class phpbb_extension_extension_base_test extends phpbb_test_case $reflection_class = new ReflectionClass('\phpbb\extension\base'); self::$reflection_method_get_migration_file_list = $reflection_class->getMethod('get_migration_file_list'); - self::$reflection_method_get_migration_file_list->setAccessible(true); } protected function setUp(): void diff --git a/tests/files/types_local_test.php b/tests/files/types_local_test.php index ea1fa23ecb..9cdbb50ced 100644 --- a/tests/files/types_local_test.php +++ b/tests/files/types_local_test.php @@ -146,7 +146,6 @@ class phpbb_files_types_local_test extends phpbb_test_case 'mimetype.extension_guesser' => new \phpbb\mimetype\extension_guesser(), ))); $filespec_local = new ReflectionProperty($filespec, 'local'); - $filespec_local->setAccessible(true); $filespec_local->setValue($filespec, true); $this->container->set('files.filespec', $filespec); $this->factory = new \phpbb\files\factory($this->container); diff --git a/tests/files/upload_test.php b/tests/files/upload_test.php index ab88b1cd83..beee220fd8 100644 --- a/tests/files/upload_test.php +++ b/tests/files/upload_test.php @@ -76,7 +76,6 @@ class phpbb_files_upload_test extends phpbb_test_case { $upload = new \phpbb\files\upload($this->factory, $this->language, $this->php_ini, $this->request); $disallowed_content = new ReflectionProperty($upload, 'disallowed_content'); - $disallowed_content->setAccessible(true); $upload->set_disallowed_content(array('foo')); $this->assertEquals(array('foo'), $disallowed_content->getValue($upload)); diff --git a/tests/filesystem/helper_realpath_test.php b/tests/filesystem/helper_realpath_test.php index 848a855a4d..448b2665bc 100644 --- a/tests/filesystem/helper_realpath_test.php +++ b/tests/filesystem/helper_realpath_test.php @@ -22,7 +22,6 @@ class phpbb_filesystem_helper_realpath_test extends phpbb_test_case parent::setUpBeforeClass(); self::$filesystem_helper_phpbb_own_realpath = new ReflectionMethod('\phpbb\filesystem\helper', 'phpbb_own_realpath'); - self::$filesystem_helper_phpbb_own_realpath->setAccessible(true); } protected function setUp(): void diff --git a/tests/filesystem/realpath_test.php b/tests/filesystem/realpath_test.php index 8119541844..75e34ea240 100644 --- a/tests/filesystem/realpath_test.php +++ b/tests/filesystem/realpath_test.php @@ -24,7 +24,6 @@ class phpbb_filesystem_realpath_test extends phpbb_test_case $reflection_class = new ReflectionClass('\phpbb\filesystem\filesystem'); self::$filesystem_own_realpath = $reflection_class->getMethod('phpbb_own_realpath'); - self::$filesystem_own_realpath->setAccessible(true); } protected function setUp(): void diff --git a/tests/group/helper_test_case.php b/tests/group/helper_test_case.php index 1514c616a9..3ee1d86b86 100644 --- a/tests/group/helper_test_case.php +++ b/tests/group/helper_test_case.php @@ -87,12 +87,10 @@ class phpbb_group_helper_test_case extends phpbb_test_case // Set default language files loaded flag to true $loaded_flag = $reflection_class->getProperty('common_language_files_loaded'); - $loaded_flag->setAccessible(true); $loaded_flag->setValue($lang, true); // Set up test language data $lang_array = $reflection_class->getProperty('lang'); - $lang_array->setAccessible(true); $lang_array->setValue($lang, $this->get_test_language_data_set()); // Set up event dispatcher diff --git a/tests/language/language_test.php b/tests/language/language_test.php index 2b1b245491..eaf2d5c800 100644 --- a/tests/language/language_test.php +++ b/tests/language/language_test.php @@ -30,12 +30,10 @@ class phpbb_language_test extends phpbb_test_case // Set default language files loaded flag to true $loaded_flag = $reflection_class->getProperty('common_language_files_loaded'); - $loaded_flag->setAccessible(true); $loaded_flag->setValue($this->lang, true); // Set up test language data $lang_array = $reflection_class->getProperty('lang'); - $lang_array->setAccessible(true); $lang_array->setValue($this->lang, $this->get_test_data_set()); } diff --git a/tests/messenger/queue_test.php b/tests/messenger/queue_test.php index a7f336b14a..457604fb25 100644 --- a/tests/messenger/queue_test.php +++ b/tests/messenger/queue_test.php @@ -191,7 +191,6 @@ class phpbb_messenger_queue_test extends phpbb_test_case $filesystem->method('phpbb_chmod') ->will($this->throwException(new filesystem_exception('Chmod failed'))); $filesystem_reflection = new \ReflectionProperty(queue::class, 'filesystem'); - $filesystem_reflection->setAccessible(true); $filesystem_reflection->setValue($this->messenger_queue, $filesystem); // Process the queue @@ -312,7 +311,6 @@ class phpbb_messenger_queue_test extends phpbb_test_case $filesystem->method('phpbb_chmod') ->will($this->throwException(new filesystem_exception('Chmod failed'))); $filesystem_reflection = new \ReflectionProperty(queue::class, 'filesystem'); - $filesystem_reflection->setAccessible(true); $filesystem_reflection->setValue($this->messenger_queue, $filesystem); $this->messenger_queue->save(); diff --git a/tests/migrator/get_callable_from_step_test.php b/tests/migrator/get_callable_from_step_test.php index 02ee53e172..467ec99aa8 100644 --- a/tests/migrator/get_callable_from_step_test.php +++ b/tests/migrator/get_callable_from_step_test.php @@ -137,7 +137,6 @@ class get_callable_from_step_test extends phpbb_database_test_case { $class = new ReflectionClass($this->migrator); $method = $class->getMethod('get_callable_from_step'); - $method->setAccessible(true); return $method->invokeArgs($this->migrator, array($step)); } } diff --git a/tests/notification/notification_method_email_test.php b/tests/notification/notification_method_email_test.php index 71ebffef89..0634e3abd4 100644 --- a/tests/notification/notification_method_email_test.php +++ b/tests/notification/notification_method_email_test.php @@ -126,7 +126,6 @@ class notification_method_email_test extends phpbb_tests_notification_base $class = new ReflectionClass($notification_method_email); $empty_queue_method = $class->getMethod('empty_queue'); - $empty_queue_method->setAccessible(true); $this->notification_method_email->method('notify_using_messenger') ->will($this->returnCallback(function () use ($notification_method_email, $empty_queue_method) { diff --git a/tests/notification/notification_method_webpush_test.php b/tests/notification/notification_method_webpush_test.php index a1b7e6325e..d2e4957912 100644 --- a/tests/notification/notification_method_webpush_test.php +++ b/tests/notification/notification_method_webpush_test.php @@ -680,7 +680,6 @@ class notification_method_webpush_test extends phpbb_tests_notification_base public function test_set_endpoint_padding($endpoint, $expected_padding): void { $web_push_reflection = new \ReflectionMethod($this->notification_method_webpush, 'set_endpoint_padding'); - $web_push_reflection->setAccessible(true); $auth = [ 'VAPID' => [ diff --git a/tests/template/extension_test.php b/tests/template/extension_test.php index 323c605fb9..c40a58da53 100644 --- a/tests/template/extension_test.php +++ b/tests/template/extension_test.php @@ -84,7 +84,6 @@ class phpbb_template_extension_test extends phpbb_template_template_test_case $class = new ReflectionClass('\phpbb\avatar\manager'); $enabled_drivers = $class->getProperty('enabled_drivers'); - $enabled_drivers->setAccessible(true); $enabled_drivers->setValue($class, false); $avatar_helper = new phpbb\avatar\helper( $config, diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php index 3d3b560e5a..68a3a5985d 100644 --- a/tests/template/template_test_case.php +++ b/tests/template/template_test_case.php @@ -35,7 +35,6 @@ class phpbb_template_template_test_case extends phpbb_test_case $reflection = new ReflectionClass('\phpbb\language\language'); self::$language_reflection_lang = $reflection->getProperty('lang'); - self::$language_reflection_lang->setAccessible(true); } protected function display($handle) diff --git a/tests/template/twig_test.php b/tests/template/twig_test.php index f655cd8702..23a14b4b4f 100644 --- a/tests/template/twig_test.php +++ b/tests/template/twig_test.php @@ -128,7 +128,6 @@ class twig_test extends \phpbb_test_case // Get loader instance $template_reflection = new \ReflectionObject($this->template); $loader_reflection = $template_reflection->getProperty('loader'); - $loader_reflection->setAccessible(true); /** @var \phpbb\template\twig\loader $loader */ $loader = $loader_reflection->getValue($this->template); diff --git a/tests/text_reparser/plugins/post_text_test.php b/tests/text_reparser/plugins/post_text_test.php index 8e63ca7256..0333afd95b 100644 --- a/tests/text_reparser/plugins/post_text_test.php +++ b/tests/text_reparser/plugins/post_text_test.php @@ -74,7 +74,6 @@ class phpbb_textreparser_post_text_test extends phpbb_textreparser_test_row_base // Call reparse_record via reflection $reparser = $this->get_reparser(); $reparser_reflection = new \ReflectionMethod($reparser, 'reparse_record'); - $reparser_reflection->setAccessible(true); $reparser_reflection->invoke($reparser, $record); // Retrieve reparsed post text and compare with expectec diff --git a/tests/text_reparser/plugins/test_row_based_plugin.php b/tests/text_reparser/plugins/test_row_based_plugin.php index 60b3e30584..425054f4c1 100644 --- a/tests/text_reparser/plugins/test_row_based_plugin.php +++ b/tests/text_reparser/plugins/test_row_based_plugin.php @@ -27,7 +27,6 @@ abstract class phpbb_textreparser_test_row_based_plugin extends phpbb_database_t $reflection_reparser = new ReflectionClass(get_class($reparser)); $table_property = $reflection_reparser->getProperty('table'); - $table_property->setAccessible(true); $sql = 'SELECT ' . $columns['id'] . ' AS id, ' . $columns['text'] . ' AS text FROM ' . $table_property->getValue($reparser) . ' diff --git a/tests/ucp/controller_webpush_test.php b/tests/ucp/controller_webpush_test.php index e1e5373862..9539fa73dc 100644 --- a/tests/ucp/controller_webpush_test.php +++ b/tests/ucp/controller_webpush_test.php @@ -422,7 +422,6 @@ class test_ucp_controller_webpush_test extends phpbb_database_test_case $this->expectExceptionMessage('FORM_INVALID'); $check_subscribe_reflection = new ReflectionMethod($this->controller, 'check_subscribe_requests'); - $check_subscribe_reflection->setAccessible(true); $check_subscribe_reflection->invoke($this->controller); } @@ -436,7 +435,6 @@ class test_ucp_controller_webpush_test extends phpbb_database_test_case $this->expectExceptionMessage('NO_AUTH_OPERATION'); $check_subscribe_reflection = new ReflectionMethod($this->controller, 'check_subscribe_requests'); - $check_subscribe_reflection->setAccessible(true); $check_subscribe_reflection->invoke($this->controller); } diff --git a/tests/upload/filespec_test.php b/tests/upload/filespec_test.php index 032ab56803..ed20275783 100644 --- a/tests/upload/filespec_test.php +++ b/tests/upload/filespec_test.php @@ -83,7 +83,6 @@ class phpbb_filespec_test extends phpbb_test_case private function set_reflection_property($class, $property_name, $value) { $property = new ReflectionProperty($class, $property_name); - $property->setAccessible(true); $property->setValue($class, $value); } @@ -538,7 +537,6 @@ class phpbb_filespec_test extends phpbb_test_case $filespec = new \phpbb\files\filespec($this->filesystem, $this->language, new \bantu\IniGetWrapper\IniGetWrapper, new \FastImageSize\FastImageSize(), $this->phpbb_root_path, null); $reflection_filespec = new ReflectionClass($filespec); $plupload_property = $reflection_filespec->getProperty('plupload'); - $plupload_property->setAccessible(true); $plupload_mock = $this->getMockBuilder('\phpbb\plupload\plupload') ->disableOriginalConstructor() ->getMock();