diff --git a/features/scaffold-plugin-tests.feature b/features/scaffold-plugin-tests.feature index da516dfa..4b91ae05 100644 --- a/features/scaffold-plugin-tests.feature +++ b/features/scaffold-plugin-tests.feature @@ -284,3 +284,28 @@ Feature: Scaffold plugin unit tests """ bootstrap.php """ + + Scenario: Scaffold plugin tests with custom main file + Given a WP install + And a wp-content/plugins/foo/bar.php file: + """ + $slug, - "{$type}_package" => $package, + "{$type}_slug" => $slug, + "{$type}_package" => $package, + "{$type}_main_file" => $main_file, ]; $force = Utils\get_flag_value( $assoc_args, 'force' ); diff --git a/templates/plugin-bootstrap.mustache b/templates/plugin-bootstrap.mustache index efaaa314..e35163a9 100644 --- a/templates/plugin-bootstrap.mustache +++ b/templates/plugin-bootstrap.mustache @@ -29,7 +29,7 @@ require_once "{$_tests_dir}/includes/functions.php"; * Manually load the plugin being tested. */ function _manually_load_plugin() { - require dirname( dirname( __FILE__ ) ) . '/{{plugin_slug}}.php'; + require dirname( dirname( __FILE__ ) ) . '/{{plugin_main_file}}'; } tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );