Bug 15669: Add a test for GetModificationTemplates
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 3 Mar 2016 10:28:56 +0000 (10:28 +0000)
committerBrendan A Gallagher <brendan@bywatersolutions.com>
Thu, 3 Mar 2016 22:11:44 +0000 (22:11 +0000)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
t/db_dependent/MarcModificationTemplates.t

index f54527e..3ea702a 100644 (file)
@@ -1,6 +1,6 @@
 use Modern::Perl;
 
-use Test::More tests => 94;
+use Test::More tests => 95;
 
 use Koha::SimpleMARC;
 
@@ -336,6 +336,16 @@ is_deeply( \@fields_245a, [
         'Bad title'
     ], 'delete field has been deleted the right field"' );
 
+subtest 'GetModificationTemplates' => sub {
+    plan tests => 1;
+    $dbh->do(q|DELETE FROM marc_modification_templates|);
+    AddModificationTemplate("zzz");
+    AddModificationTemplate("aaa");
+    AddModificationTemplate("mmm");
+    my @templates = GetModificationTemplates();
+    is_deeply( [map{$_->{name}} @templates], ['aaa', 'mmm', 'zzz'] );
+};
+
 sub new_record {
     my $record = MARC::Record->new;
     $record->leader('03174nam a2200445 a 4500');