|
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 => 29; |
22 |
use Test::More tests => 30; |
| 23 |
use Test::MockModule; |
23 |
use Test::MockModule; |
| 24 |
use Test::Warn; |
24 |
use Test::Warn; |
| 25 |
|
25 |
|
|
Lines 1188-1193
EOF
Link Here
|
| 1188 |
is( $letter->{content}, $expected_content ); |
1188 |
is( $letter->{content}, $expected_content ); |
| 1189 |
}; |
1189 |
}; |
| 1190 |
|
1190 |
|
|
|
1191 |
subtest 'Execute TT process in a DB transaction' => sub { |
| 1192 |
plan tests => 2; |
| 1193 |
my $code = 'TEST_TXN'; |
| 1194 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
| 1195 |
my $template = <<EOF; |
| 1196 |
=[% branch.branchcode %]= |
| 1197 |
[%~ branch.delete ~%] |
| 1198 |
EOF |
| 1199 |
reset_template({ template => $template, code => $code, module => 'test' }); |
| 1200 |
my $letter = GetPreparedLetter( |
| 1201 |
module => 'test', |
| 1202 |
letter_code => $code, |
| 1203 |
tables => { |
| 1204 |
branches => $library->branchcode, |
| 1205 |
} |
| 1206 |
); |
| 1207 |
my $branchcode = $library->branchcode; |
| 1208 |
like($letter->{content}, qr{=$branchcode=}, 'content generated with the library'); |
| 1209 |
is( ref($library->get_from_storage), 'Koha::Library', 'calling ->delete on the object has not been comitted'); |
| 1210 |
}; |
| 1211 |
|
| 1191 |
sub reset_template { |
1212 |
sub reset_template { |
| 1192 |
my ( $params ) = @_; |
1213 |
my ( $params ) = @_; |
| 1193 |
my $template = $params->{template}; |
1214 |
my $template = $params->{template}; |
| 1194 |
- |
|
|