Lines 19-25
Link Here
|
19 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
19 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
20 |
|
20 |
|
21 |
use Modern::Perl; |
21 |
use Modern::Perl; |
22 |
use Test::More tests => 28; |
22 |
use Test::More tests => 29; |
23 |
use Test::MockModule; |
23 |
use Test::MockModule; |
24 |
use Test::Warn; |
24 |
use Test::Warn; |
25 |
|
25 |
|
Lines 1176-1181
EOF
Link Here
|
1176 |
is( $letter->{content}, $expected_content ); |
1176 |
is( $letter->{content}, $expected_content ); |
1177 |
}; |
1177 |
}; |
1178 |
|
1178 |
|
|
|
1179 |
subtest 'Execute TT process in a DB transaction' => sub { |
1180 |
plan tests => 2; |
1181 |
my $code = 'TEST_TXN'; |
1182 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
1183 |
my $template = <<EOF; |
1184 |
=[% branch.branchcode %]= |
1185 |
[%~ branch.delete ~%] |
1186 |
EOF |
1187 |
reset_template({ template => $template, code => $code, module => 'test' }); |
1188 |
my $letter = GetPreparedLetter( |
1189 |
module => 'test', |
1190 |
letter_code => $code, |
1191 |
tables => { |
1192 |
branches => $library->branchcode, |
1193 |
} |
1194 |
); |
1195 |
my $branchcode = $library->branchcode; |
1196 |
like($letter->{content}, qr{=$branchcode=}, 'content generated with the library'); |
1197 |
is( ref($library->get_from_storage), 'Koha::Library', 'calling ->delete on the object has not been comitted'); |
1198 |
}; |
1199 |
|
1179 |
sub reset_template { |
1200 |
sub reset_template { |
1180 |
my ( $params ) = @_; |
1201 |
my ( $params ) = @_; |
1181 |
my $template = $params->{template}; |
1202 |
my $template = $params->{template}; |
1182 |
- |
|
|