From 70c13d834b3d20af97123e7373873020a209a674 Mon Sep 17 00:00:00 2001 From: Jay Allen Date: Wed, 17 Nov 2010 20:48:21 -0800 Subject: [PATCH] [#481] [#632] Modified test plugins to more closely approximate their initialization with that of actual plugins. Also added non-enclosed YAML plugin to test for its *lack* of loading --- t/plugins/Awesome/config.yaml | 8 +++++--- t/plugins/Rebless/config.yaml | 6 +++--- t/plugins/stray.pl | 16 +++++++++++++++- t/plugins/stray.yaml | 4 ++++ t/plugins/subfoldered/subfoldered.pl | 2 +- 5 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 t/plugins/stray.yaml diff --git a/t/plugins/Awesome/config.yaml b/t/plugins/Awesome/config.yaml index 19e9438c0..86097e2e8 100644 --- a/t/plugins/Awesome/config.yaml +++ b/t/plugins/Awesome/config.yaml @@ -1,6 +1,8 @@ -name: Awesome -key: awesome -id: awesome +name: "Oh Awesome" +key: Awesome +id: Awesome +description: 'A plugin to test plugin initialization and data object extension' +version: '1.0' object_types: awesome: MT::Awesome diff --git a/t/plugins/Rebless/config.yaml b/t/plugins/Rebless/config.yaml index a974bd59f..7fa22a61a 100644 --- a/t/plugins/Rebless/config.yaml +++ b/t/plugins/Rebless/config.yaml @@ -1,4 +1,4 @@ -id: 'ReblessMe-Plugin' -name: 'Rebless Me' +name: 'Rebless Me' +id: 'ReblessMe' +key: 'ReblessMe' plugin_class: 'Rebless::Plugin' - diff --git a/t/plugins/stray.pl b/t/plugins/stray.pl index fe9b8d299..05d0cb9a1 100644 --- a/t/plugins/stray.pl +++ b/t/plugins/stray.pl @@ -4,9 +4,23 @@ # # $Id$ -package __FILE__; +package MT::Plugin::NakedPerl; use strict; +use warnings; +use base 'MT::Plugin'; +our $VERSION = '0.1'; + +my $plugin; +MT->add_plugin($plugin = __PACKAGE__->new({ + name => "Naked perl-initialized test", + version => $VERSION, + description => "Bad legacy plugin without a plugin envelope. No cookie", + author_name => "Whatnot Smith", + key => 'NakedPerl', + id => 'NakedPerl', +})); + use MT::Template::Context; MT::Template::Context->add_tag( EzPlug => sub {1} ); diff --git a/t/plugins/stray.yaml b/t/plugins/stray.yaml new file mode 100644 index 000000000..fb340b14b --- /dev/null +++ b/t/plugins/stray.yaml @@ -0,0 +1,4 @@ +name: The Stray Camel +key: StrayCamel +id: StrayCamel +description: A YAML initialized plugin but no plugin envelope diff --git a/t/plugins/subfoldered/subfoldered.pl b/t/plugins/subfoldered/subfoldered.pl index 8998fbeed..d8c37dafd 100644 --- a/t/plugins/subfoldered/subfoldered.pl +++ b/t/plugins/subfoldered/subfoldered.pl @@ -1,10 +1,10 @@ +#!/usr/bin/perl package MT::Plugin::Subfoldered; use strict; use warnings; use base 'MT::Plugin'; our $VERSION = '0.1'; -use MT; my $plugin; MT->add_plugin($plugin = __PACKAGE__->new({