fix unit test for getting plugin data

This commit is contained in:
Daniel Hüsken 2024-11-20 09:54:03 +01:00
parent 279e3841fa
commit 8b2d7f2cf0
No known key found for this signature in database
GPG key ID: 9F732DA37FA709E8
2 changed files with 2 additions and 2 deletions

View file

@ -67,7 +67,7 @@ class FilePathPluginFactory implements FilePathPluginFactoryInterface {
'RequiresPlugins' => 'Requires Plugins',
);
$plugin_data = get_file_data( $filePath, $default_headers, 'plugin' );
$plugin_data = \get_file_data( $filePath, $default_headers, 'plugin' );
if ( empty( $plugin_data ) ) {
throw new UnexpectedValueException(

View file

@ -31,7 +31,7 @@ class TestCase extends \PHPUnit\Framework\TestCase
when('wc_string_to_bool')->alias(function ($string) {
return is_bool( $string ) ? $string : ( 'yes' === strtolower( $string ) || 1 === $string || 'true' === strtolower( $string ) || '1' === $string );
});
when('get_plugin_data')->justReturn(['Version' => '1.0']);
when('get_file_data')->justReturn(['Version' => '1.0']);
when('plugin_basename')->justReturn('woocommerce-paypal-payments/woocommerce-paypal-payments.php');
when('get_transient')->returnArg();