1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-10-05 20:21:53 +02:00

Merge pull request #6849 from rxu/ticket/17543

[ticket/17543] Update composer and dependencies and provide better support for PHP 8.5
This commit is contained in:
Marc Alexander
2025-09-17 20:55:39 +02:00
committed by GitHub
42 changed files with 704 additions and 619 deletions

View File

@@ -23,6 +23,18 @@
<group>slow</group>
</exclude>
</groups>
<source restrictDeprecations="true">
<include>
<directory suffix=".php">../phpBB/</directory>
<directory suffix=".php">../tests/</directory>
</include>
<exclude>
<directory suffix=".php">../phpBB/vendor/</directory>
<directory suffix=".php">../phpBB/cache/</directory>
<directory suffix=".php">../phpBB/develop/</directory>
<directory suffix=".php">../phpBB/store/</directory>
</exclude>
</source>
<php>
<server name="PHPBB_TEST_DBMS" value="mysqli"/>
<server name="PHPBB_TEST_DBHOST" value="0.0.0.0"/>

View File

@@ -23,6 +23,18 @@
<group>slow</group>
</exclude>
</groups>
<source restrictDeprecations="true">
<include>
<directory suffix=".php">../phpBB/</directory>
<directory suffix=".php">../tests/</directory>
</include>
<exclude>
<directory suffix=".php">../phpBB/vendor/</directory>
<directory suffix=".php">../phpBB/cache/</directory>
<directory suffix=".php">../phpBB/develop/</directory>
<directory suffix=".php">../phpBB/store/</directory>
</exclude>
</source>
<php>
<server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\mssqlnative"/>
<server name="PHPBB_TEST_DBHOST" value="127.0.0.1"/>

View File

@@ -23,6 +23,18 @@
<group>slow</group>
</exclude>
</groups>
<source restrictDeprecations="true">
<include>
<directory suffix=".php">../phpBB/</directory>
<directory suffix=".php">../tests/</directory>
</include>
<exclude>
<directory suffix=".php">../phpBB/vendor/</directory>
<directory suffix=".php">../phpBB/cache/</directory>
<directory suffix=".php">../phpBB/develop/</directory>
<directory suffix=".php">../phpBB/store/</directory>
</exclude>
</source>
<php>
<server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\mysqli"/>
<server name="PHPBB_TEST_DBHOST" value="0.0.0.0"/>

View File

@@ -23,6 +23,18 @@
<group>slow</group>
</exclude>
</groups>
<source restrictDeprecations="true">
<include>
<directory suffix=".php">../phpBB/</directory>
<directory suffix=".php">../tests/</directory>
</include>
<exclude>
<directory suffix=".php">../phpBB/vendor/</directory>
<directory suffix=".php">../phpBB/cache/</directory>
<directory suffix=".php">../phpBB/develop/</directory>
<directory suffix=".php">../phpBB/store/</directory>
</exclude>
</source>
<php>
<server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\postgres"/>
<server name="PHPBB_TEST_DBHOST" value="localhost"/>

View File

@@ -23,6 +23,18 @@
<group>slow</group>
</exclude>
</groups>
<source restrictDeprecations="true">
<include>
<directory suffix=".php">../phpBB/</directory>
<directory suffix=".php">../tests/</directory>
</include>
<exclude>
<directory suffix=".php">../phpBB/vendor/</directory>
<directory suffix=".php">../phpBB/cache/</directory>
<directory suffix=".php">../phpBB/develop/</directory>
<directory suffix=".php">../phpBB/store/</directory>
</exclude>
</source>
<php>
<server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\postgres"/>
<server name="PHPBB_TEST_DBHOST" value="localhost"/>

View File

@@ -23,6 +23,18 @@
<group>slow</group>
</exclude>
</groups>
<source restrictDeprecations="true">
<include>
<directory suffix=".php">../phpBB/</directory>
<directory suffix=".php">../tests/</directory>
</include>
<exclude>
<directory suffix=".php">../phpBB/vendor/</directory>
<directory suffix=".php">../phpBB/cache/</directory>
<directory suffix=".php">../phpBB/develop/</directory>
<directory suffix=".php">../phpBB/store/</directory>
</exclude>
</source>
<php>
<server name="PHPBB_TEST_REDIS_HOST" value="0.0.0.0"/>
<server name="PHPBB_TEST_MEMCACHED_HOST" value="localhost"/>

View File

@@ -522,7 +522,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, intl, gd, exif, iconv, pgsql, pdo_pgsql, sodium
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, intl, gd, exif, iconv, pgsql, pdo_pgsql, sodium, bz2, fileinfo
ini-values: upload_tmp_dir=${{ runner.temp }}, sys_temp_dir=${{ runner.temp }}
coverage: none

Binary file not shown.

1155
phpBB/composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -763,8 +763,6 @@ function create_thumbnail($source, $destination, $mimetype)
imagewebp($new_image, $destination);
break;
}
imagedestroy($new_image);
}
else
{

View File

@@ -325,7 +325,7 @@ class recaptcha_v3 extends captcha_abstract
$token = $request->variable('recaptcha_token', '', true);
$action = $request->variable('recaptcha_action', '', true);
$action = in_array($action, self::$actions) ? $action : reset(self::$actions);
$threshold = (double) $config["recaptcha_v3_threshold_{$action}"] ?? 0.5;
$threshold = (float) $config["recaptcha_v3_threshold_{$action}"] ?? 0.5;
// No token was provided, discard spam submissions
if (empty($token))

View File

@@ -150,7 +150,18 @@ class connection_parameter_factory
if ($params['driver'] === 'pdo_mysql' && extension_loaded('pdo_mysql'))
{
$params[\PDO::MYSQL_ATTR_FOUND_ROWS] = true;
// Constant PDO::MYSQL_ATTR_FOUND_ROWS is deprecated since 8.5, use Pdo\Mysql::ATTR_FOUND_ROWS instead
if (class_exists('\Pdo\Mysql'))
{
/**
* @psalm-suppress UndefinedClass
*/
$params[\Pdo\Mysql::ATTR_FOUND_ROWS] = true;
}
else
{
$params[\PDO::MYSQL_ATTR_FOUND_ROWS] = true;
}
}
return $params;

View File

@@ -386,7 +386,7 @@ class post extends \phpbb\notification\type\base
// Topics can be "read" before they are public (while awaiting approval).
// Make sure that if the user has read the topic, it's marked as read in the notification
if ($this->inherit_read_status && isset($pre_create_data[$this->user_id]) && $pre_create_data[$this->user_id] >= $this->notification_time)
if ($this->inherit_read_status && isset($this->user_id, $pre_create_data[$this->user_id]) && $pre_create_data[$this->user_id] >= $this->notification_time)
{
$this->notification_read = true;
}

View File

@@ -1577,7 +1577,7 @@ class fulltext_native extends base implements search_backend_interface
// Remove common words
if ($this->config['num_posts'] >= 100 && $this->config['fulltext_native_common_thres'])
{
$common_threshold = ((double) $this->config['fulltext_native_common_thres']) / 100.0;
$common_threshold = ((float) $this->config['fulltext_native_common_thres']) / 100.0;
// First, get the IDs of common words
$sql = 'SELECT word_id, word_text
FROM ' . $this->search_wordlist_table . '
@@ -2034,14 +2034,14 @@ class fulltext_native extends base implements search_backend_interface
</dl>
<dl>
<dt><label for="fulltext_native_common_thres">' . $this->language->lang('COMMON_WORD_THRESHOLD') . $this->language->lang('COLON') . '</label><br /><span>' . $this->language->lang('COMMON_WORD_THRESHOLD_EXPLAIN') . '</span></dt>
<dd><input id="fulltext_native_common_thres" type="text" name="config[fulltext_native_common_thres]" value="' . (double) $this->config['fulltext_native_common_thres'] . '" /> %</dd>
<dd><input id="fulltext_native_common_thres" type="text" name="config[fulltext_native_common_thres]" value="' . (float) $this->config['fulltext_native_common_thres'] . '" /> %</dd>
</dl>
';
// These are fields required in the config table
return array(
'tpl' => $tpl,
'config' => array('fulltext_native_load_upd' => 'bool', 'fulltext_native_min_chars' => 'integer:0:255', 'fulltext_native_max_chars' => 'integer:0:255', 'fulltext_native_common_thres' => 'double:0:100')
'config' => array('fulltext_native_load_upd' => 'bool', 'fulltext_native_min_chars' => 'integer:0:255', 'fulltext_native_max_chars' => 'integer:0:255', 'fulltext_native_common_thres' => 'float:0:100')
);
}
}

View File

@@ -26,10 +26,16 @@
<group>slow</group>
</exclude>
</groups>
<source>
<source restrictDeprecations="true">
<include>
<directory suffix=".php">./phpBB/includes/</directory>
<directory suffix=".php">./phpBB/phpbb/</directory>
<directory suffix=".php">./phpBB/</directory>
<directory suffix=".php">./tests/</directory>
</include>
<exclude>
<directory suffix=".php">./phpBB/vendor/</directory>
<directory suffix=".php">./phpBB/cache/</directory>
<directory suffix=".php">./phpBB/develop/</directory>
<directory suffix=".php">./phpBB/store/</directory>
</exclude>
</source>
</phpunit>

View File

@@ -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);

View File

@@ -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));
}

View File

@@ -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

View File

@@ -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

View File

@@ -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',

View File

@@ -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);
}

View File

@@ -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()

View File

@@ -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

View File

@@ -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);

View File

@@ -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));

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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());
}

View File

@@ -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();

View File

@@ -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));
}
}

View File

@@ -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) {

View File

@@ -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' => [

View File

@@ -187,7 +187,7 @@ class phpbb_profilefield_type_bool_test extends phpbb_test_case
public function is_set_callback($field_id, $lang_id, $field_value)
{
return isset($this->options[$field_value]);
return isset($field_value, $this->options[$field_value]);
}
public function get($field_id, $lang_id, $field_value)

View File

@@ -225,7 +225,7 @@ class phpbb_profilefield_type_dropdown_test extends phpbb_test_case
public function is_set_callback($field_id, $lang_id, $field_value)
{
return isset($this->dropdown_options[$field_value]);
return isset($field_value, $this->dropdown_options[$field_value]);
}
public function get($field_id, $lang_id, $field_value)

View File

@@ -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,

View File

@@ -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)

View File

@@ -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);

View File

@@ -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

View File

@@ -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) . '

View File

@@ -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);
}

View File

@@ -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();