From 312d3c25b8474d6b14277077a9f3e42bd1298a3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Borbo=C3=ABn?= Date: Thu, 12 Dec 2019 11:41:57 +0100 Subject: [PATCH] Ensure that the pot file use the same license as the plugin * Only if the license file header is defined * Tests updated --- features/makepot.feature | 28 ++++++++++++++++++++++++++++ src/MakePotCommand.php | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/features/makepot.feature b/features/makepot.feature index 8ea9db64..6de1f3ec 100644 --- a/features/makepot.feature +++ b/features/makepot.feature @@ -80,6 +80,34 @@ Feature: Generate a POT file of a WordPress project # This file is distributed under the same license as the Hello World plugin. """ + Scenario: Use the same license as the plugin + Given an empty foo-plugin directory + And a foo-plugin/foo-plugin.php file: + """ + main_file_data['Plugin Name'] ) ) { - if ( isset( $this->main_file_data['License'] ) ) { + if ( isset( $this->main_file_data['License'] ) && ! empty( $this->main_file_data['License'] ) ) { return sprintf( "Copyright (C) %1\$s %2\$s\nThis file is distributed under the %3\$s.", date( 'Y' ), // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date