Bugzilla – Attachment 68778 Details for
Bug 19096
Koha to MARC mappings (Part 2): Make Default authoritative
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19096: Restructure MarcSubfieldStructures.t first
Bug-19096-Restructure-MarcSubfieldStructurest-firs.patch (text/plain), 3.33 KB, created by
Kyle M Hall (khall)
on 2017-10-27 16:53:50 UTC
(
hide
)
Description:
Bug 19096: Restructure MarcSubfieldStructures.t first
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2017-10-27 16:53:50 UTC
Size:
3.33 KB
patch
obsolete
>From e30b0c5a8335cf9ce571fdb781ac9975400080ab Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 17 Aug 2017 11:44:18 +0200 >Subject: [PATCH] Bug 19096: Restructure MarcSubfieldStructures.t first > >Before adding more tests, move all current tests in one subtest. > >Test plan: >Run t/db_dependent/Koha/MarcSubfieldStructures.t > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/Koha/MarcSubfieldStructures.t | 43 +++++++++++++++------------- > 1 file changed, 23 insertions(+), 20 deletions(-) > >diff --git a/t/db_dependent/Koha/MarcSubfieldStructures.t b/t/db_dependent/Koha/MarcSubfieldStructures.t >index b7ff454..d65f4cc 100644 >--- a/t/db_dependent/Koha/MarcSubfieldStructures.t >+++ b/t/db_dependent/Koha/MarcSubfieldStructures.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 3; >+use Test::More tests => 1; > > use Koha::MarcSubfieldStructure; > use Koha::MarcSubfieldStructures; >@@ -30,27 +30,30 @@ use t::lib::TestBuilder; > my $schema = Koha::Database->new->schema; > $schema->storage->txn_begin; > >-my $builder = t::lib::TestBuilder->new; >-my $nb_of_fields = Koha::MarcSubfieldStructures->search->count; >-my $framework = $builder->build({ source => 'BiblioFramework' }); >-my $new_field_1 = Koha::MarcSubfieldStructure->new({ >- frameworkcode => $framework->{frameworkcode}, >- tagfield => 200, >- tagsubfield => 'a', >-})->store; >-my $new_field_2 = Koha::MarcSubfieldStructure->new({ >- frameworkcode => $framework->{frameworkcode}, >- tagfield => 245, >- tagsubfield => 'a', >-})->store; >+subtest 'Trivial tests' => sub { >+ plan tests => 3; > >-is( Koha::MarcSubfieldStructures->search->count, $nb_of_fields + 2, 'The 2 fields should have been added' ); >+ my $builder = t::lib::TestBuilder->new; >+ my $nb_of_fields = Koha::MarcSubfieldStructures->search->count; >+ my $framework = $builder->build({ source => 'BiblioFramework' }); >+ my $new_field_1 = Koha::MarcSubfieldStructure->new({ >+ frameworkcode => $framework->{frameworkcode}, >+ tagfield => 200, >+ tagsubfield => 'a', >+ })->store; >+ my $new_field_2 = Koha::MarcSubfieldStructure->new({ >+ frameworkcode => $framework->{frameworkcode}, >+ tagfield => 245, >+ tagsubfield => 'a', >+ })->store; > >-my $retrieved_fields = Koha::MarcSubfieldStructures->search({ frameworkcode => $framework->{frameworkcode}, tagfield => 200, tagsubfield => 'a' }); >-is( $retrieved_fields->count, 1, 'Search for a field by frameworkcode, tagfield and tagsubfield should return the field' ); >+ is( Koha::MarcSubfieldStructures->search->count, $nb_of_fields + 2, 'The 2 fields should have been added' ); > >-$retrieved_fields->next->delete; >-is( Koha::MarcSubfieldStructures->search->count, $nb_of_fields + 1, 'Delete should have deleted the field' ); >+ my $retrieved_fields = Koha::MarcSubfieldStructures->search({ frameworkcode => $framework->{frameworkcode}, tagfield => 200, tagsubfield => 'a' }); >+ is( $retrieved_fields->count, 1, 'Search for a field by frameworkcode, tagfield and tagsubfield should return the field' ); > >-$schema->storage->txn_rollback; >+ $retrieved_fields->next->delete; >+ is( Koha::MarcSubfieldStructures->search->count, $nb_of_fields + 1, 'Delete should have deleted the field' ); >+}; > >+$schema->storage->txn_rollback; >-- >2.10.2
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 19096
:
66333
|
66334
|
66335
|
66336
|
66337
|
66338
|
66406
|
66407
|
66408
|
66409
|
66410
|
66411
|
67508
|
67509
|
67510
|
67511
|
67512
|
67513
|
67590
|
67591
|
67592
|
67593
|
67594
|
67595
|
68205
|
68206
|
68207
|
68208
|
68209
|
68210
|
68774
|
68775
|
68776
|
68777
| 68778 |
68779
|
69629
|
69646
|
69647
|
69681