App::ZofCMS::Test::Plugin - test module for testing ZofCMS plugins
#!/usr/bin/env perl use strict; use warnings; use Test::More; eval "use App::ZofCMS::Test::Plugin;"; plan skip_all => "App::ZofCMS::Test::Plugin required for testing plugin" if $@; plugin_ok( 'PlugName', # plugin's name { input => 'Foo' }, # plugin takes input via first level 'input' key { foo => 'bar' }, # query parameters );
The module provides a basic test suit for ZofCMS plugins. See SYNOPSIS for usage. That would be in one of your t/test.t files.
plugin_ok( 'PlugName', # plugin's name { input => 'Foo' }, # plugin takes input via first level 'input' key { foo => 'bar' }, # query parameters { foo => 'bar' }, # the loaded "main config" file hashref );
Takes three arguments, second, third and fourth are optional. First argument is the name of your plugin with the App::ZofCMS::Plugin:: part stripped off (i.e. the name that you would use in ZofCMS template to include the plugin). Second parameter is optional, it must be a hashref which would represent the input from your plugin. In the example above the plugin takes input via first level key input in ZofCMS template. This is basically to check that any first level keys used by the plugin are deleted by the plugin. Third parameter is optional and is also a hashref which represents query parameters with keys being parameters names and values being parameters' values. Use this if your plugin depends on some query parameters. Fourth parameter is again a hashref which represents the hashref normally present in ZofCMS "main configuration file".
App::ZofCMS::Plugin::
input
Fork this module on GitHub: https://github.com/zoffixznet/App-ZofCMS
To report bugs or request features, please use https://github.com/zoffixznet/App-ZofCMS/issues
If you can't access GitHub, you can email your request to bug-App-ZofCMS at rt.cpan.org
bug-App-ZofCMS at rt.cpan.org
Zoffix Znet <zoffix at cpan.org> (http://zoffix.com/, http://haslayout.net/)
You can use and distribute this module under the same terms as Perl itself. See the LICENSE file included in this distribution for complete details.
LICENSE
To install App::ZofCMS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::ZofCMS
CPAN shell
perl -MCPAN -e shell install App::ZofCMS
For more information on module installation, please visit the detailed CPAN module installation guide.