|
Lines 4-10
Link Here
|
| 4 |
# This needs to be extended! Your help is appreciated.. |
4 |
# This needs to be extended! Your help is appreciated.. |
| 5 |
|
5 |
|
| 6 |
use Modern::Perl; |
6 |
use Modern::Perl; |
| 7 |
use Test::More tests => 10; |
7 |
use Test::More tests => 9; |
| 8 |
|
8 |
|
| 9 |
use t::lib::Mocks; |
9 |
use t::lib::Mocks; |
| 10 |
use t::lib::TestBuilder; |
10 |
use t::lib::TestBuilder; |
|
Lines 188-215
subtest "Test build_custom_field_string" => sub {
Link Here
|
| 188 |
|
188 |
|
| 189 |
}; |
189 |
}; |
| 190 |
|
190 |
|
| 191 |
subtest "update_lastseen tests" => sub { |
|
|
| 192 |
plan tests => 2; |
| 193 |
|
| 194 |
my $seen_patron = $builder->build( |
| 195 |
{ |
| 196 |
source => 'Borrower', |
| 197 |
value => { |
| 198 |
lastseen => "2001-01-01", |
| 199 |
} |
| 200 |
} |
| 201 |
); |
| 202 |
my $sip_patron = C4::SIP::ILS::Patron->new( $seen_patron->{cardnumber} ); |
| 203 |
t::lib::Mocks::mock_preference( 'TrackLastPatronActivity', '' ); |
| 204 |
$sip_patron->update_lastseen(); |
| 205 |
$seen_patron = Koha::Patrons->find({ cardnumber => $seen_patron->{cardnumber} }); |
| 206 |
is( output_pref({str => $seen_patron->lastseen(), dateonly => 1}), output_pref({str => '2001-01-01', dateonly => 1}),'Last seen not updated if not tracking patrons'); |
| 207 |
t::lib::Mocks::mock_preference( 'TrackLastPatronActivity', '1' ); |
| 208 |
$sip_patron->update_lastseen(); |
| 209 |
$seen_patron = Koha::Patrons->find({ cardnumber => $seen_patron->cardnumber() }); |
| 210 |
is( output_pref({str => $seen_patron->lastseen(), dateonly => 1}), output_pref({dt => dt_from_string(), dateonly => 1}),'Last seen updated to today if tracking patrons'); |
| 211 |
}; |
| 212 |
|
| 213 |
subtest "fine_items tests" => sub { |
191 |
subtest "fine_items tests" => sub { |
| 214 |
|
192 |
|
| 215 |
plan tests => 12; |
193 |
plan tests => 12; |
| 216 |
- |
|
|