Make WordPress Core


Ignore:
Timestamp:
09/10/2021 05:26:42 PM (3 years ago)
Author:
hellofromTonya
Message:

Tests: Fix "null to non-nullable" deprecation notice in Tests_Admin_IncludesPlugin::test_get_plugin_files_folder().

The Tests_Admin_IncludesPlugin::_create_plugin() expects the first parameter to be a text string to be written to a plugin file using fwrite().

Passing null causes a fwrite(): Passing null to parameter #2 ($data) of type string is deprecated notice.

Ref: https://www.php.net/manual/en/function.fwrite

Follow-up to [31002]. [41806].

Props jrf, hellofromTonya.
See #53635.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/admin/includesPlugin.php

    r51639 r51800  
    367367        $plugin_dir = WP_PLUGIN_DIR . '/list_files_test_plugin';
    368368        @mkdir( $plugin_dir );
    369         $plugin = $this->_create_plugin( null, 'list_files_test_plugin.php', $plugin_dir );
     369        $plugin = $this->_create_plugin( '', 'list_files_test_plugin.php', $plugin_dir );
    370370
    371371        $sub_dir = trailingslashit( dirname( $plugin[1] ) ) . 'subdir';
Note: See TracChangeset for help on using the changeset viewer.