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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51800 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Tonya Mork 2021-09-10 17:26:42 +00:00
parent 14f92886f1
commit c64c2d77aa

View File

@ -366,7 +366,7 @@ class Tests_Admin_IncludesPlugin extends WP_UnitTestCase {
public function test_get_plugin_files_folder() {
$plugin_dir = WP_PLUGIN_DIR . '/list_files_test_plugin';
@mkdir( $plugin_dir );
$plugin = $this->_create_plugin( null, 'list_files_test_plugin.php', $plugin_dir );
$plugin = $this->_create_plugin( '', 'list_files_test_plugin.php', $plugin_dir );
$sub_dir = trailingslashit( dirname( $plugin[1] ) ) . 'subdir';
mkdir( $sub_dir );