Lines 2-12
Link Here
|
2 |
|
2 |
|
3 |
use Modern::Perl; |
3 |
use Modern::Perl; |
4 |
|
4 |
|
5 |
use Test::More tests => 11; |
5 |
use Test::More tests => 12; |
6 |
|
6 |
|
7 |
use_ok("MARC::Field"); |
7 |
use_ok("MARC::Field"); |
8 |
use_ok("MARC::Record"); |
8 |
use_ok("MARC::Record"); |
9 |
use_ok("Koha::SimpleMARC", qw( field_exists read_field update_field copy_field copy_and_replace_field move_field delete_field field_equals )); |
9 |
use_ok( |
|
|
10 |
"Koha::SimpleMARC", |
11 |
qw( field_exists read_field update_field copy_field copy_and_replace_field move_field delete_field field_equals update_last_transaction_time ) |
12 |
); |
10 |
|
13 |
|
11 |
sub new_record { |
14 |
sub new_record { |
12 |
my $record = MARC::Record->new; |
15 |
my $record = MARC::Record->new; |
Lines 1833-1835
subtest 'field_equals' => sub {
Link Here
|
1833 |
is_deeply( $match, [1], 'first 008 control field matches "eng"' ); |
1836 |
is_deeply( $match, [1], 'first 008 control field matches "eng"' ); |
1834 |
}; |
1837 |
}; |
1835 |
}; |
1838 |
}; |
1836 |
- |
1839 |
|
|
|
1840 |
subtest 'update_last_transaction_time' => sub { |
1841 |
plan tests => 3; |
1842 |
my $record = MARC::Record->new; |
1843 |
update_last_transaction_time( { record => $record } ); |
1844 |
my $value1 = $record->field('005')->data; |
1845 |
like( $value1, qr/^\d{14}\.0$/, 'Looks like a 005' ); |
1846 |
sleep 1; |
1847 |
update_last_transaction_time( { record => $record } ); |
1848 |
my $value2 = $record->field('005')->data; |
1849 |
like( $value2, qr/^\d{14}\.0$/, 'Still looks like a 005' ); |
1850 |
isnt( $value1, $value2, 'Should not be the same a second later' ); |
1851 |
}; |