|
Line 0
Link Here
|
|
|
1 |
package t::db_dependent::TestObjects::LetterTemplates::ExampleLetterTemplates; |
| 2 |
|
| 3 |
# Copyright Vaara-kirjastot 2015 |
| 4 |
# |
| 5 |
# This file is part of Koha. |
| 6 |
# |
| 7 |
# Koha is free software; you can redistribute it and/or modify it under the |
| 8 |
# terms of the GNU General Public License as published by the Free Software |
| 9 |
# Foundation; either version 3 of the License, or (at your option) any later |
| 10 |
# version. |
| 11 |
# |
| 12 |
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY |
| 13 |
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
| 14 |
# A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
| 15 |
# |
| 16 |
# You should have received a copy of the GNU General Public License along |
| 17 |
# with Koha; if not, write to the Free Software Foundation, Inc., |
| 18 |
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 19 |
# |
| 20 |
|
| 21 |
use Modern::Perl; |
| 22 |
use Carp; |
| 23 |
|
| 24 |
use t::db_dependent::TestObjects::LetterTemplates::LetterTemplateFactory; |
| 25 |
|
| 26 |
=head createTestGroupX |
| 27 |
|
| 28 |
You should use the appropriate Factory-class to create these test-objects. |
| 29 |
|
| 30 |
=cut |
| 31 |
|
| 32 |
my @testGroup1Identifiers = ('circulation-ODUE1-CPL-print', 'circulation-ODUE2-CPL-print', 'circulation-ODUE3-CPL-print', |
| 33 |
'circulation-ODUE1-CPL-email', 'circulation-ODUE2-CPL-email', 'circulation-ODUE3-CPL-email', |
| 34 |
'circulation-ODUE1-CPL-sms', 'circulation-ODUE2-CPL-sms', 'circulation-ODUE3-CPL-sms', |
| 35 |
); |
| 36 |
|
| 37 |
sub createTestGroup1 { |
| 38 |
my @letterTemplates = ( |
| 39 |
{letter_id => $testGroup1Identifiers[0], |
| 40 |
module => 'circulation', code => 'ODUE1', branchcode => 'CPL', name => 'Notice1', |
| 41 |
is_html => undef, title => 'Notice1', message_transport_type => 'print', |
| 42 |
content => '<item>Barcode: <<items.barcode>>, bring it back!</item>', |
| 43 |
}, |
| 44 |
{letter_id => $testGroup1Identifiers[0], |
| 45 |
module => 'circulation', code => 'ODUE2', branchcode => 'CPL', name => 'Notice2', |
| 46 |
is_html => undef, title => 'Notice2', message_transport_type => 'print', |
| 47 |
content => '<item>Barcode: <<items.barcode>></item>', |
| 48 |
}, |
| 49 |
{letter_id => $testGroup1Identifiers[0], |
| 50 |
module => 'circulation', code => 'ODUE3', branchcode => 'CPL', name => 'Notice3', |
| 51 |
is_html => undef, title => 'Notice3', message_transport_type => 'print', |
| 52 |
content => '<item>Barcode: <<items.barcode>>, bring back!</item>', |
| 53 |
}, |
| 54 |
{letter_id => $testGroup1Identifiers[0], |
| 55 |
module => 'circulation', code => 'ODUE1', branchcode => 'CPL', name => 'Notice1', |
| 56 |
is_html => undef, title => 'Notice1', message_transport_type => 'email', |
| 57 |
content => '<item>Barcode: <<items.barcode>>, bring it back!</item>', |
| 58 |
}, |
| 59 |
{letter_id => $testGroup1Identifiers[0], |
| 60 |
module => 'circulation', code => 'ODUE2', branchcode => 'CPL', name => 'Notice2', |
| 61 |
is_html => undef, title => 'Notice2', message_transport_type => 'email', |
| 62 |
content => '<item>Barcode: <<items.barcode>></item>', |
| 63 |
}, |
| 64 |
{letter_id => $testGroup1Identifiers[0], |
| 65 |
module => 'circulation', code => 'ODUE3', branchcode => 'CPL', name => 'Notice3', |
| 66 |
is_html => undef, title => 'Notice3', message_transport_type => 'email', |
| 67 |
content => '<item>Barcode: <<items.barcode>>, bring back!</item>', |
| 68 |
}, |
| 69 |
{letter_id => $testGroup1Identifiers[0], |
| 70 |
module => 'circulation', code => 'ODUE1', branchcode => 'CPL', name => 'Notice1', |
| 71 |
is_html => undef, title => 'Notice1', message_transport_type => 'sms', |
| 72 |
content => '<item>Barcode: <<items.barcode>>, bring it back!</item>', |
| 73 |
}, |
| 74 |
{letter_id => $testGroup1Identifiers[0], |
| 75 |
module => 'circulation', code => 'ODUE2', branchcode => 'CPL', name => 'Notice2', |
| 76 |
is_html => undef, title => 'Notice2', message_transport_type => 'sms', |
| 77 |
content => '<item>Barcode: <<items.barcode>></item>', |
| 78 |
}, |
| 79 |
{letter_id => $testGroup1Identifiers[0], |
| 80 |
module => 'circulation', code => 'ODUE3', branchcode => 'CPL', name => 'Notice3', |
| 81 |
is_html => undef, title => 'Notice3', message_transport_type => 'sms', |
| 82 |
content => '<item>Barcode: <<items.barcode>>, bring back!</item>', |
| 83 |
}, |
| 84 |
); |
| 85 |
|
| 86 |
return t::db_dependent::TestObjects::LetterTemplates::LetterTemplateFactory::createTestGroup(\@letterTemplates); |
| 87 |
} |
| 88 |
sub deleteTestGroup1 { |
| 89 |
t::db_dependent::TestObjects::LetterTemplates::LetterTemplateFactory::_deleteTestGroupFromIdentifiers(\@testGroup1Identifiers); |
| 90 |
} |
| 91 |
|
| 92 |
1; |