Bugzilla – Attachment 168080 Details for
Bug 27182
Add ability to rename a MARC modification template
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27182: Unit tests
Bug-27182-Unit-tests.patch (text/plain), 2.32 KB, created by
Lucas Gass (lukeg)
on 2024-06-25 15:30:22 UTC
(
hide
)
Description:
Bug 27182: Unit tests
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2024-06-25 15:30:22 UTC
Size:
2.32 KB
patch
obsolete
>From ead771fbb2e6e5b3f32696e2e70639a55582d9be Mon Sep 17 00:00:00 2001 >From: Sam Lau <samalau@gmail.com> >Date: Mon, 24 Jun 2024 19:54:02 +0000 >Subject: [PATCH] Bug 27182: Unit tests > >To test: >prove t/db_dependent/MarcModificationTemplates.t > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > t/db_dependent/MarcModificationTemplates.t | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/MarcModificationTemplates.t b/t/db_dependent/MarcModificationTemplates.t >index 35adf6919d..67e5dda2d5 100755 >--- a/t/db_dependent/MarcModificationTemplates.t >+++ b/t/db_dependent/MarcModificationTemplates.t >@@ -2,7 +2,7 @@ > > use Modern::Perl; > >-use Test::More tests => 129; >+use Test::More tests => 130; > > use Koha::Database; > use Koha::SimpleMARC; >@@ -11,7 +11,7 @@ use t::lib::Mocks; > > use_ok("MARC::Field"); > use_ok("MARC::Record"); >-use_ok('C4::MarcModificationTemplates', qw( AddModificationTemplate AddModificationTemplateAction GetModificationTemplateAction GetModificationTemplateActions ModModificationTemplateAction MoveModificationTemplateAction DelModificationTemplate DelModificationTemplateAction ModifyRecordWithTemplate GetModificationTemplates )); >+use_ok('C4::MarcModificationTemplates', qw( AddModificationTemplate AddModificationTemplateAction GetModificationTemplateAction GetModificationTemplateActions ModModificationTemplateAction MoveModificationTemplateAction DelModificationTemplate DelModificationTemplateAction ModifyRecordWithTemplate GetModificationTemplates RenameModificationTemplate)); > > my $schema = Koha::Database->new->schema; > $schema->storage->txn_begin; >@@ -386,6 +386,17 @@ subtest 'GetModificationTemplates' => sub { > is_deeply( [map{$_->{name}} @templates], ['aaa', 'mmm', 'zzz'] ); > }; > >+subtest 'RenameModificationTemplate' => sub { >+ plan tests => 1; >+ $dbh->do(q|DELETE FROM marc_modification_templates|); >+ my $template_id = AddModificationTemplate("koah"); >+ my $template_id2 = AddModificationTemplate("sma"); >+ RenameModificationTemplate("koha", $template_id); >+ RenameModificationTemplate("sam", $template_id2); >+ my @templates = GetModificationTemplates(); >+ is_deeply( [map{$_->{name}} @templates], ['koha', 'sam'] ); >+}; >+ > subtest "not_equals" => sub { > plan tests => 2; > $dbh->do(q|DELETE FROM marc_modification_templates|); >-- >2.39.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 27182
:
168041
|
168042
|
168045
|
168077
|
168079
| 168080 |
168081
|
168082
|
168083
|
171294
|
171295