Bugzilla – Attachment 60400 Details for
Bug 17958
Add the Koha::Notice::Template[s] packages (letter table)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17958: Add tests for Koha::Notice::Template[s]
Bug-17958-Add-tests-for-KohaNoticeTemplates.patch (text/plain), 2.98 KB, created by
Nick Clemens (kidclamp)
on 2017-02-17 11:19:31 UTC
(
hide
)
Description:
Bug 17958: Add tests for Koha::Notice::Template[s]
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-02-17 11:19:31 UTC
Size:
2.98 KB
patch
obsolete
>From 79b9045ddf57f18cb49b216e3ac318bf42377005 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 23 Jan 2017 12:35:13 +0100 >Subject: [PATCH] Bug 17958: Add tests for Koha::Notice::Template[s] > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/Koha/Notices.t | 71 +++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 71 insertions(+) > create mode 100644 t/db_dependent/Koha/Notices.t > >diff --git a/t/db_dependent/Koha/Notices.t b/t/db_dependent/Koha/Notices.t >new file mode 100644 >index 0000000..3f90f9f >--- /dev/null >+++ b/t/db_dependent/Koha/Notices.t >@@ -0,0 +1,71 @@ >+#!/usr/bin/perl >+ >+# Copyright 2017 Koha Development team >+# >+# This file is part of Koha >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Test::More tests => 3; >+ >+use Koha::Notice::Templates; >+use Koha::Database; >+ >+use t::lib::TestBuilder; >+ >+my $schema = Koha::Database->new->schema; >+$schema->storage->txn_begin; >+ >+my $builder = t::lib::TestBuilder->new; >+my $library = $builder->build( { source => 'Branch' } ); >+my $nb_of_templates = Koha::Notice::Templates->search->count; >+my ( $module, $mtt ) = ( 'circulation', 'email' ); >+my $new_template = Koha::Notice::Template->new( >+ { >+ module => $module, >+ code => 'tmpl_code_for_t', >+ branchcode => $library->{branchcode}, >+ name => 'my template name for test 1', >+ title => 'my template title for test 1', >+ content => 'This one is almost empty', >+ message_transport_type => $mtt, >+ } >+)->store; >+ >+is( >+ Koha::Notice::Templates->search->count, >+ $nb_of_templates + 1, >+ 'The template should have been added' >+); >+ >+my $retrieved_template = Koha::Notice::Templates->find( >+ { >+ module => $module, >+ code => $new_template->code, >+ branchcode => $library->{branchcode}, >+ message_transport_type => $mtt, >+ } >+); >+is( $retrieved_template->name, $new_template->name, >+ 'Find a notice template by pk should return the correct template' ); >+ >+$retrieved_template->delete; >+is( Koha::Notice::Templates->search->count, >+ $nb_of_templates, 'Delete should have deleted the template' ); >+ >+$schema->storage->txn_rollback; >+ >+1; >-- >2.1.4
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 17958
:
59401
|
59402
|
59403
|
59404
|
59466
|
59467
|
60399
| 60400