Bugzilla – Attachment 89810 Details for
Bug 22834
Add a method for plugins to return the absolute path for bundled files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22834: Add tests for Koha::Plugins::Base->bundle_path
Bug-22834-Add-tests-for-KohaPluginsBase-bundlepath.patch (text/plain), 2.55 KB, created by
Agustín Moyano
on 2019-05-16 03:06:02 UTC
(
hide
)
Description:
Bug 22834: Add tests for Koha::Plugins::Base->bundle_path
Filename:
MIME Type:
Creator:
Agustín Moyano
Created:
2019-05-16 03:06:02 UTC
Size:
2.55 KB
patch
obsolete
>From 8af1c91bd51a3c1bbab1a4f02311b49203724090 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 2 May 2019 15:51:17 -0300 >Subject: [PATCH] Bug 22834: Add tests for Koha::Plugins::Base->bundle_path > >Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> >--- > t/db_dependent/Plugins.t | 43 +++++++++++++++++++++---------------------- > 1 file changed, 21 insertions(+), 22 deletions(-) > >diff --git a/t/db_dependent/Plugins.t b/t/db_dependent/Plugins.t >index c72f27d683..8b30e25594 100755 >--- a/t/db_dependent/Plugins.t >+++ b/t/db_dependent/Plugins.t >@@ -18,7 +18,9 @@ use Modern::Perl; > > use Archive::Extract; > use CGI; >+use Cwd qw(abs_path); > use File::Basename; >+use File::Spec; > use File::Temp qw( tempdir tempfile ); > use FindBin qw($Bin); > use Module::Load::Conditional qw(can_load); >@@ -88,27 +90,6 @@ subtest 'Version upgrade tests' => sub { > $schema->storage->txn_rollback; > }; > >-subtest 'Version upgrade tests' => sub { >- >- plan tests => 1; >- >- $schema->storage->txn_begin; >- >- my $plugin = Koha::Plugin::Test->new( { enable_plugins => 1, cgi => CGI->new } ); >- >- # make sure there's no version on the DB >- $schema->resultset('PluginData') >- ->search( { plugin_class => $plugin->{class}, plugin_key => '__INSTALLED_VERSION__' } ) >- ->delete; >- >- $plugin = Koha::Plugin::Test->new( { enable_plugins => 1, cgi => CGI->new } ); >- my $version = $plugin->retrieve_data('__INSTALLED_VERSION__'); >- >- is( $version, $plugin->get_metadata->{version}, 'Version has been populated correctly' ); >- >- $schema->storage->txn_rollback; >-}; >- > $schema->storage->txn_begin; > Koha::Plugins::Methods->delete; > >@@ -272,6 +253,24 @@ subtest 'Test _version_compare' => sub { > is( Koha::Plugins::Base::_version_compare( '1.0', '1.0.0' ), 0, "1.0 is equal to 1.0.0" ); > }; > >+subtest 'bundle_path() tests' => sub { >+ >+ plan tests => 1; >+ >+ t::lib::Mocks::mock_config( 'enable_plugins', 1 ); >+ >+ my @current_dir = File::Spec->splitdir(abs_path(__FILE__)); >+ # remote Plugins.t >+ pop @current_dir; >+ # remove db_dependent >+ pop @current_dir; >+ >+ my $plugin = Koha::Plugin::Test->new; >+ >+ is( $plugin->bundle_path, File::Spec->catdir(@current_dir) . '/lib/Koha/Plugin/Test' ); >+ >+}; >+ > subtest 'new() tests' => sub { > > plan tests => 2; >@@ -286,4 +285,4 @@ subtest 'new() tests' => sub { > is( ref($result), 'Koha::Plugins', 'calling new with enable_plugins makes it override the config' ); > }; > >-$schema->storage->txn_rollback; >\ No newline at end of file >+$schema->storage->txn_rollback; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22834
:
89258
|
89259
|
89260
|
89261
|
89660
|
89661
|
89809
|
89810
|
89811
|
90181
|
90182