Bugzilla – Attachment 62373 Details for
Bug 18182
TestBuilder should be able to return Koha::Object objects
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18182: Tests all Koha::Objects-based modules
Bug-18182-Tests-all-KohaObjects-based-modules.patch (text/plain), 1.99 KB, created by
Tomás Cohen Arazi (tcohen)
on 2017-04-19 14:23:43 UTC
(
hide
)
Description:
Bug 18182: Tests all Koha::Objects-based modules
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2017-04-19 14:23:43 UTC
Size:
1.99 KB
patch
obsolete
>From 9328944b15950a533b78bc5c5a1bc17c1a48cf0f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 12 Apr 2017 15:19:33 -0300 >Subject: [PATCH] Bug 18182: Tests all Koha::Objects-based modules > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Added test description on line 387. >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/TestBuilder.t | 20 ++++++++++++++++++-- > 1 file changed, 18 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/TestBuilder.t b/t/db_dependent/TestBuilder.t >index efce9c3..3d04950 100644 >--- a/t/db_dependent/TestBuilder.t >+++ b/t/db_dependent/TestBuilder.t >@@ -21,7 +21,7 @@ use Modern::Perl; > > use Test::More tests => 12; > use Test::Warn; >-use Data::Dumper qw(Dumper); >+use File::Basename qw(dirname); > > use Koha::Database; > use Koha::Patrons; >@@ -344,7 +344,7 @@ subtest 'Default values' => sub { > > subtest 'build_object() tests' => sub { > >- plan tests => 5; >+ plan tests => 6; > > $builder = t::lib::TestBuilder->new(); > >@@ -371,6 +371,22 @@ subtest 'build_object() tests' => sub { > is( $issuing_rule, undef, > 'If the class parameter is missing, undef is returned' ); > >+ subtest 'Test all classes' => sub { >+ my $Koha_modules_dir = dirname(__FILE__) . '/../../Koha'; >+ my @koha_object_based_modules = `/bin/grep -rl 'sub object_class' $Koha_modules_dir`; >+ my @source_in_failure; >+ for my $module_filepath ( @koha_object_based_modules ) { >+ chomp $module_filepath; >+ next unless $module_filepath =~ m|\.pm$|; >+ my $module = $module_filepath; >+ $module =~ s|^.*/(Koha.*)\.pm$|$1|; >+ $module =~ s|/|::|g; >+ next if $module eq 'Koha::Objects'; >+ eval "require $module";; >+ my $object = $builder->build_object( { class => $module } ); >+ is( ref($object), $module->object_class, "Testing $module" ); >+ } >+ }; > }; > > $schema->storage->txn_rollback; >-- >2.7.4
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 18182
:
60819
|
60820
|
61702
|
61752
|
61753
|
62113
|
62114
|
62121
|
62122
|
62371
|
62372
|
62373
|
62374
|
62383
|
62384
|
62385
|
62386