Bugzilla – Attachment 59402 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::Letter[s]
Bug-17958-Add-tests-for-KohaLetters.patch (text/plain), 2.77 KB, created by
Jonathan Druart
on 2017-01-23 11:37:25 UTC
(
hide
)
Description:
Bug 17958: Add tests for Koha::Letter[s]
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-01-23 11:37:25 UTC
Size:
2.77 KB
patch
obsolete
>From 0a65671b5dd7dad7ab89c7e4c86b6895b35fadf9 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::Letter[s] > >--- > t/db_dependent/Koha/Letters.t | 71 +++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 71 insertions(+) > create mode 100644 t/db_dependent/Koha/Letters.t > >diff --git a/t/db_dependent/Koha/Letters.t b/t/db_dependent/Koha/Letters.t >new file mode 100644 >index 0000000..8a1e9f3 >--- /dev/null >+++ b/t/db_dependent/Koha/Letters.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::Letters; >+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_letters = Koha::Letters->search->count; >+my ( $module, $mtt ) = ( 'circulation', 'email' ); >+my $new_letter = Koha::Letter->new( >+ { >+ module => $module, >+ code => 'letter_code_for_t', >+ branchcode => $library->{branchcode}, >+ name => 'my letter name for test 1', >+ title => 'my letter title for test 1', >+ content => 'This one is almost empty', >+ message_transport_type => $mtt, >+ } >+)->store; >+ >+is( >+ Koha::Letters->search->count, >+ $nb_of_letters + 1, >+ 'The letter should have been added' >+); >+ >+my $retrieved_letter = Koha::Letters->find( >+ { >+ module => $module, >+ code => $new_letter->code, >+ branchcode => $library->{branchcode}, >+ message_transport_type => $mtt, >+ } >+); >+is( $retrieved_letter->name, $new_letter->name, >+ 'Find a letter by id should return the correct letter' ); >+ >+$retrieved_letter->delete; >+is( Koha::Letters->search->count, >+ $nb_of_letters, 'Delete should have deleted the letter' ); >+ >+$schema->storage->txn_rollback; >+ >+1; >-- >2.9.3
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