2
0
Fork 0
mirror of https://github.com/discourse/wp-discourse.git synced 2025-10-03 08:59:21 +08:00

Handle PHP deprecations (#515)

* Update deprecated callable use

See https://wiki.php.net/rfc/deprecate_partially_supported_callables

* Update phpunit config
This commit is contained in:
Angus McLeod 2024-04-03 20:00:35 +02:00 committed by GitHub
parent 5a272ec782
commit 21a1453eae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 24 deletions

View file

@ -223,7 +223,7 @@ class Discourse {
$saved_values = get_option( 'discourse_configurable_text' );
$default_values = $this->discourse_configurable_text;
$merged_values = array_merge( $default_values, $saved_values );
array_walk( $merged_values, 'self::register_text_translations' );
array_walk( $merged_values, self::class . '::register_text_translations' );
update_option( $group_name, $merged_values );
} else {
add_option( $group_name, $this->$group_name );

View file

@ -1,5 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/phpunit/bootstrap.php" backupGlobals="false" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" convertDeprecationsToExceptions="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="tests/phpunit/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
convertDeprecationsToExceptions="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">lib</directory>

View file

@ -1,25 +1,12 @@
<?xml version="1.0"?>
<phpunit
bootstrap="bootstrap.php"
backupGlobals="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
convertDeprecationsToExceptions="false"
>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="bootstrap.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" convertDeprecationsToExceptions="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage/>
<php>
<const name="WP_TESTS_MULTISITE" value="1" />
<const name="WP_TESTS_MULTISITE" value="1"/>
</php>
<testsuites>
<testsuite name="multisite">
<directory prefix="test-" suffix=".php">multisite/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<file>lib/discourse-publish.php</file>
<file>lib/sync-discourse-topic.php</file>
</whitelist>
</filter>
</phpunit>