View | Details | Raw Unified | Return to bug 27182
Collapse All | Expand All

(-)a/t/db_dependent/MarcModificationTemplates.t (-3 / +13 lines)
Lines 2-8 Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Test::More tests => 129;
5
use Test::More tests => 130;
6
6
7
use Koha::Database;
7
use Koha::Database;
8
use Koha::SimpleMARC;
8
use Koha::SimpleMARC;
Lines 11-17 use t::lib::Mocks; Link Here
11
11
12
use_ok("MARC::Field");
12
use_ok("MARC::Field");
13
use_ok("MARC::Record");
13
use_ok("MARC::Record");
14
use_ok('C4::MarcModificationTemplates', qw( AddModificationTemplate AddModificationTemplateAction GetModificationTemplateAction GetModificationTemplateActions ModModificationTemplateAction MoveModificationTemplateAction DelModificationTemplate DelModificationTemplateAction ModifyRecordWithTemplate GetModificationTemplates ));
14
use_ok('C4::MarcModificationTemplates', qw( AddModificationTemplate AddModificationTemplateAction GetModificationTemplateAction GetModificationTemplateActions ModModificationTemplateAction MoveModificationTemplateAction DelModificationTemplate DelModificationTemplateAction ModifyRecordWithTemplate GetModificationTemplates RenameModificationTemplate));
15
15
16
my $schema = Koha::Database->new->schema;
16
my $schema = Koha::Database->new->schema;
17
$schema->storage->txn_begin;
17
$schema->storage->txn_begin;
Lines 386-391 subtest 'GetModificationTemplates' => sub { Link Here
386
    is_deeply( [map{$_->{name}} @templates], ['aaa', 'mmm', 'zzz'] );
386
    is_deeply( [map{$_->{name}} @templates], ['aaa', 'mmm', 'zzz'] );
387
};
387
};
388
388
389
subtest 'RenameModificationTemplate' => sub {
390
    plan tests => 1;
391
    $dbh->do(q|DELETE FROM marc_modification_templates|);
392
    my $template_id = AddModificationTemplate("koah");
393
    my $template_id2 = AddModificationTemplate("sma");
394
    RenameModificationTemplate("koha", $template_id);
395
    RenameModificationTemplate("sam", $template_id2);
396
    my @templates = GetModificationTemplates();
397
    is_deeply( [map{$_->{name}} @templates], ['koha', 'sam'] );
398
};
399
389
subtest "not_equals" => sub {
400
subtest "not_equals" => sub {
390
    plan tests => 2;
401
    plan tests => 2;
391
    $dbh->do(q|DELETE FROM marc_modification_templates|);
402
    $dbh->do(q|DELETE FROM marc_modification_templates|);
392
- 

Return to bug 27182