|
Lines 2029-2035
$retrieved_patron_1->delete;
Link Here
|
| 2029 |
is( Koha::Patrons->search->count, $nb_of_patrons - 1, 'Delete should have deleted the patron' ); |
2029 |
is( Koha::Patrons->search->count, $nb_of_patrons - 1, 'Delete should have deleted the patron' ); |
| 2030 |
|
2030 |
|
| 2031 |
subtest 'BorrowersLog and CardnumberLog tests' => sub { |
2031 |
subtest 'BorrowersLog and CardnumberLog tests' => sub { |
| 2032 |
plan tests => 13; |
2032 |
plan tests => 16; |
| 2033 |
|
2033 |
|
| 2034 |
t::lib::Mocks::mock_preference( 'BorrowersLog', 1 ); |
2034 |
t::lib::Mocks::mock_preference( 'BorrowersLog', 1 ); |
| 2035 |
t::lib::Mocks::mock_preference( 'CardnumberLog', 0 ); |
2035 |
t::lib::Mocks::mock_preference( 'CardnumberLog', 0 ); |
|
Lines 2081-2086
subtest 'BorrowersLog and CardnumberLog tests' => sub {
Link Here
|
| 2081 |
'With CardnumberLog, one detailed MODIFY_CARDNUMBER action should be logged for the modification.' |
2081 |
'With CardnumberLog, one detailed MODIFY_CARDNUMBER action should be logged for the modification.' |
| 2082 |
); |
2082 |
); |
| 2083 |
|
2083 |
|
|
|
2084 |
## test for historic_cardnumber accessor |
| 2085 |
my @historic_cardnumbers = @{ $patron->historic_cardnumbers }; |
| 2086 |
is( |
| 2087 |
$historic_cardnumbers[0]->{previous_cardnumber}, 'TESTCARDNUMBER', |
| 2088 |
'previous_cardnumber in historic_cardnumbers[0] should be TESTCARDNUMBER' |
| 2089 |
); |
| 2090 |
is( |
| 2091 |
$historic_cardnumbers[0]->{new_cardnumber}, 'TESTCARDNUMBER_1', |
| 2092 |
'new_cardnumber in historic_cardnumbers[0] should be TESTCARDNUMBER_1' |
| 2093 |
); |
| 2094 |
is( |
| 2095 |
exists( $historic_cardnumbers[0]->{timestamp} ), 1, |
| 2096 |
'timestamp in historic_cardnumbers[0] should be set' |
| 2097 |
); |
| 2098 |
|
| 2084 |
t::lib::Mocks::mock_preference( 'BorrowersLog', 0 ); |
2099 |
t::lib::Mocks::mock_preference( 'BorrowersLog', 0 ); |
| 2085 |
$patron->set( { cardnumber => 'TESTCARDNUMBER' } )->store; |
2100 |
$patron->set( { cardnumber => 'TESTCARDNUMBER' } )->store; |
| 2086 |
@logs = $schema->resultset('ActionLog') |
2101 |
@logs = $schema->resultset('ActionLog') |
| 2087 |
- |
|
|