Skip to content

Commit c64c2d7

Browse files
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
1 parent 14f9288 commit c64c2d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/phpunit/tests/admin/includesPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ public function test_get_plugin_files_single() {
366366
public function test_get_plugin_files_folder() {
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';
372372
mkdir( $sub_dir );

0 commit comments

Comments
 (0)