Skip to content

Commit

Permalink
Tests: Fix "null to non-nullable" deprecation notice in `Tests_Admin_…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
hellofromtonya committed Sep 10, 2021
1 parent 14f9288 commit c64c2d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/phpunit/tests/admin/includesPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public function test_get_plugin_files_single() {
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 );
Expand Down

0 comments on commit c64c2d7

Please sign in to comment.