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 => 31; |
22 |
use Test::More tests => 32; |
23 |
use Test::MockModule; |
23 |
use Test::MockModule; |
24 |
use Test::Warn; |
24 |
use Test::Warn; |
25 |
|
25 |
|
Lines 1193-1198
EOF
Link Here
|
1193 |
is( $letter->{content}, $expected_content ); |
1193 |
is( $letter->{content}, $expected_content ); |
1194 |
}; |
1194 |
}; |
1195 |
|
1195 |
|
|
|
1196 |
subtest 'KohaDates::dt_from_string' => sub { |
1197 |
plan tests => 1; |
1198 |
my $code = 'TEST_DATE'; |
1199 |
t::lib::Mocks::mock_preference('dateformat', 'metric'); # MM/DD/YYYY |
1200 |
my $biblio = $builder->build_object( |
1201 |
{ |
1202 |
class => 'Koha::Biblios', |
1203 |
value => { |
1204 |
timestamp => '2018-12-13 20:21:22', |
1205 |
datecreated => '2018-12-13' |
1206 |
} |
1207 |
} |
1208 |
); |
1209 |
my $template = q{[% USE KohaDates %][% KohaDates.datetime_from_string('2000-12-01').dmy %]}; |
1210 |
|
1211 |
reset_template({ template => $template, code => $code, module => 'test' }); |
1212 |
my $letter = GetPreparedLetter( |
1213 |
module => 'test', |
1214 |
letter_code => $code, |
1215 |
tables => { |
1216 |
biblio => $biblio->biblionumber, |
1217 |
} |
1218 |
); |
1219 |
is( $letter->{content}, '01-12-2000' ); |
1220 |
}; |
1221 |
|
1196 |
subtest 'Execute TT process in a DB transaction' => sub { |
1222 |
subtest 'Execute TT process in a DB transaction' => sub { |
1197 |
plan tests => 2; |
1223 |
plan tests => 2; |
1198 |
my $code = 'TEST_TXN'; |
1224 |
my $code = 'TEST_TXN'; |
1199 |
- |
|
|