Bugzilla – Attachment 28997 Details for
Bug 11413
Marc modification template has not the expected behavior if the condition and source fields are on the same field
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11413: UT to show up the issue
Bug-11413-UT-to-show-up-the-issue.patch (text/plain), 4.46 KB, created by
Jonathan Druart
on 2014-06-19 10:41:56 UTC
(
hide
)
Description:
Bug 11413: UT to show up the issue
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-06-19 10:41:56 UTC
Size:
4.46 KB
patch
obsolete
>From 85b243d9d5374fa8ffe5b4f842425b779aeeca78 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 18 Dec 2013 09:44:25 +0100 >Subject: [PATCH] Bug 11413: UT to show up the issue > >These UT reflect this change: >- deletion of the field 245 if 245$a='Bad title' >- move of the 650 field to 651 if 650$9=499 >--- > t/db_dependent/MarcModificationTemplates.t | 52 ++++++++++++++++++++++++++---- > 1 file changed, 46 insertions(+), 6 deletions(-) > >diff --git a/t/db_dependent/MarcModificationTemplates.t b/t/db_dependent/MarcModificationTemplates.t >index 04ff80a..8e86861 100644 >--- a/t/db_dependent/MarcModificationTemplates.t >+++ b/t/db_dependent/MarcModificationTemplates.t >@@ -1,6 +1,6 @@ > use Modern::Perl; > >-use Test::More tests => 74; >+use Test::More tests => 77; > > use_ok("MARC::Field"); > use_ok("MARC::Record"); >@@ -146,16 +146,24 @@ my @USERENV = ( > C4::Context->_new_userenv ('DUMMY_SESSION_ID'); > C4::Context->set_userenv ( @USERENV ); > >-$template_id = AddModificationTemplate("template_name"); >+$template_id = AddModificationTemplate("new_template_test"); > like( $template_id, qr|^\d+$|, "new template returns an id" ); > > is( AddModificationTemplateAction( >+ $template_id, 'delete_field', 0, >+ '245', '', '', '', '', '', >+ '', '', '', >+ 'if', '245', 'a', 'equals', 'Bad title', '', >+ 'Delete field 245 if 245$a eq "Bad title"' >+), 1, 'Add first action: delete field 245 if 245$a eq "Bad title"'); >+ >+is( AddModificationTemplateAction( > $template_id, 'copy_field', 0, > '245', 'a', '', '246', 'a', > '', '', '', > '', '', '', '', '', '', > 'copy field 245$a to 246$a' >-), 1, 'Add first action: copy 245$a to 246$a'); >+), 1, 'Add second action: copy 245$a to 246$a'); > > is( AddModificationTemplateAction( > $template_id, 'delete_field', 0, >@@ -163,7 +171,7 @@ is( AddModificationTemplateAction( > '', '', '', > 'if', '650', '9', 'equals', '462', '', > 'Delete field 650$a if 650$9=462' >-), 1, 'Add second action: delete field 650$a if 650$9=462'); >+), 1, 'Add third action: delete field 650$a if 650$9=462'); > > is( AddModificationTemplateAction( > $template_id, 'update_field', 0, >@@ -171,7 +179,7 @@ is( AddModificationTemplateAction( > '', '', '', > 'unless', '650', '9', 'equals', '42', '', > 'Update field 952$p with "3010023917_updated" if 650$9 != 42' >-), 1, 'Add third action: update field 952$p with "3010023917_updated" if 650$9 != 42'); >+), 1, 'Add fourth action: update field 952$p with "3010023917_updated" if 650$9 != 42'); > > is( AddModificationTemplateAction( > $template_id, 'move_field', 0, >@@ -179,7 +187,24 @@ is( AddModificationTemplateAction( > '', '', '', > 'if', '952', 'c', 'equals', '^GEN', '1', > 'Move field 952$d to 952$e if 952$c =~ /^GE/' >-), 1, 'Add fourth action: move field 952$d to 952$e if 952$c =~ /^GE/'); >+), 1, 'Add fifth action: move field 952$d to 952$e if 952$c =~ /^GE/'); >+ >+is( AddModificationTemplateAction( >+ $template_id, 'update_field', 0, >+ '650', 'a', 'Computer algorithms.', '', '', '', >+ '', '', '', >+ 'if', '650', '9', 'equals', '499', '', >+ 'Update field 650$a with "Computer algorithms." to 651 if 650$9 == 499' >+), 1, 'Add sixth action: update field 650$a with "Computer algorithms." if 650$9 == 499'); >+ >+is( AddModificationTemplateAction( >+ $template_id, 'move_field', 0, >+ '650', '', '', '651', '', '', >+ '', '', '', >+ 'if', '650', '9', 'equals', '499', '', >+ 'Move field 650 to 651 if 650$9 == 499' >+), 1, 'Add seventh action: move field 650 to 651 if 650$9 == 499'); >+ > > my $record = new_record(); > >@@ -205,11 +230,21 @@ sub new_record { > c => 'Donald E. Knuth.', > ), > MARC::Field->new( >+ 245, '1', '4', >+ a => 'field to remove', >+ c => 'Donald E. Knuth.', >+ ), >+ MARC::Field->new( > 650, ' ', '0', > a => 'Computer programming.', > 9 => '462', > ), > MARC::Field->new( >+ 650, ' ', '0', >+ a => 'Computer programming.', >+ 9 => '499', >+ ), >+ MARC::Field->new( > 952, ' ', ' ', > p => '3010023917', > y => 'BK', >@@ -250,6 +285,11 @@ sub expected_record { > 246, '', ' ', > a => 'The art of computer programming', > ), >+ MARC::Field->new( >+ 651, ' ', '0', >+ a => 'Computer algorithms.', >+ 9 => '499', >+ ), > ); > $record->append_fields(@fields); > return $record; >-- >2.0.0.rc2
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 11413
:
23622
|
23623
|
23624
|
25758
|
25759
|
25760
|
28993
|
28994
|
28995
|
28996
|
28997
|
28998
|
29502
|
29503
|
29504
|
33213
|
33214
|
33215
|
33482
|
33483
|
33555
|
33556
|
33557
|
33558
|
33559