From c64c2d77aab0a0e1bc454b08790e6c8f3e3ec7c8 Mon Sep 17 00:00:00 2001 From: Tonya Mork Date: Fri, 10 Sep 2021 17:26:42 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/admin/includesPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/admin/includesPlugin.php b/tests/phpunit/tests/admin/includesPlugin.php index 6ba4cb33e0..7542db6b59 100644 --- a/tests/phpunit/tests/admin/includesPlugin.php +++ b/tests/phpunit/tests/admin/includesPlugin.php @@ -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 );