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:
parent
5a272ec782
commit
21a1453eae
3 changed files with 19 additions and 24 deletions
|
@ -223,7 +223,7 @@ class Discourse {
|
||||||
$saved_values = get_option( 'discourse_configurable_text' );
|
$saved_values = get_option( 'discourse_configurable_text' );
|
||||||
$default_values = $this->discourse_configurable_text;
|
$default_values = $this->discourse_configurable_text;
|
||||||
$merged_values = array_merge( $default_values, $saved_values );
|
$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 );
|
update_option( $group_name, $merged_values );
|
||||||
} else {
|
} else {
|
||||||
add_option( $group_name, $this->$group_name );
|
add_option( $group_name, $this->$group_name );
|
||||||
|
|
10
phpunit.xml
10
phpunit.xml
|
@ -1,5 +1,13 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<coverage processUncoveredFiles="true">
|
||||||
<include>
|
<include>
|
||||||
<directory suffix=".php">lib</directory>
|
<directory suffix=".php">lib</directory>
|
||||||
|
|
|
@ -1,25 +1,12 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<phpunit
|
<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">
|
||||||
bootstrap="bootstrap.php"
|
<coverage/>
|
||||||
backupGlobals="false"
|
<php>
|
||||||
colors="true"
|
<const name="WP_TESTS_MULTISITE" value="1"/>
|
||||||
convertErrorsToExceptions="true"
|
|
||||||
convertNoticesToExceptions="true"
|
|
||||||
convertWarningsToExceptions="true"
|
|
||||||
convertDeprecationsToExceptions="false"
|
|
||||||
>
|
|
||||||
<php>
|
|
||||||
<const name="WP_TESTS_MULTISITE" value="1" />
|
|
||||||
</php>
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="multisite">
|
<testsuite name="multisite">
|
||||||
<directory prefix="test-" suffix=".php">multisite/</directory>
|
<directory prefix="test-" suffix=".php">multisite/</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
<filter>
|
|
||||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
|
||||||
<file>lib/discourse-publish.php</file>
|
|
||||||
<file>lib/sync-discourse-topic.php</file>
|
|
||||||
</whitelist>
|
|
||||||
</filter>
|
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue