|
Lines 27-33
$schema->storage->txn_begin;
Link Here
|
| 27 |
|
27 |
|
| 28 |
subtest 'Test Koha::Patrons::merge' => sub { |
28 |
subtest 'Test Koha::Patrons::merge' => sub { |
| 29 |
|
29 |
|
| 30 |
plan tests => 4; |
30 |
plan tests => 3; |
| 31 |
my $builder = t::lib::TestBuilder->new; |
31 |
my $builder = t::lib::TestBuilder->new; |
| 32 |
|
32 |
|
| 33 |
my $keeper = $builder->build_object( { class => 'Koha::Patrons' } ); |
33 |
my $keeper = $builder->build_object( { class => 'Koha::Patrons' } ); |
|
Lines 49-55
subtest 'Test Koha::Patrons::merge' => sub {
Link Here
|
| 49 |
object => $keeper->id |
49 |
object => $keeper->id |
| 50 |
}, |
50 |
}, |
| 51 |
{ order_by => { -desc => "timestamp" } } |
51 |
{ order_by => { -desc => "timestamp" } } |
| 52 |
)->unblessed; |
52 |
); |
| 53 |
|
53 |
|
| 54 |
my $info_borrower1 = |
54 |
my $info_borrower1 = |
| 55 |
$borrower1->{firstname} . " " |
55 |
$borrower1->{firstname} . " " |
|
Lines 59-68
subtest 'Test Koha::Patrons::merge' => sub {
Link Here
|
| 59 |
. $keeper->firstname . " " |
59 |
. $keeper->firstname . " " |
| 60 |
. $keeper->surname . " (" |
60 |
. $keeper->surname . " (" |
| 61 |
. $keeper->cardnumber . ")"; |
61 |
. $keeper->cardnumber . ")"; |
| 62 |
my $info_log = $log->[0]{info}; |
|
|
| 63 |
|
62 |
|
| 64 |
is( |
63 |
is( |
| 65 |
$info_log, $info_borrower1, |
64 |
$log->search( { info => $info_borrower1 } )->count, 1, |
| 66 |
"GetLogs returns results in the log viewer for the merge of " . $borrower1->{borrowernumber} |
65 |
"GetLogs returns results in the log viewer for the merge of " . $borrower1->{borrowernumber} |
| 67 |
); |
66 |
); |
| 68 |
|
67 |
|
|
Lines 74-83
subtest 'Test Koha::Patrons::merge' => sub {
Link Here
|
| 74 |
. $keeper->firstname . " " |
73 |
. $keeper->firstname . " " |
| 75 |
. $keeper->surname . " (" |
74 |
. $keeper->surname . " (" |
| 76 |
. $keeper->cardnumber . ")"; |
75 |
. $keeper->cardnumber . ")"; |
| 77 |
$info_log = $log->[1]{info}; |
|
|
| 78 |
|
76 |
|
| 79 |
is( |
77 |
is( |
| 80 |
$info_log, $info_borrower2, |
78 |
$log->search( { info => $info_borrower2 } )->count, 1, |
| 81 |
"GetLogs returns results in the log viewer for the merge of " . $borrower2->{borrowernumber} |
79 |
"GetLogs returns results in the log viewer for the merge of " . $borrower2->{borrowernumber} |
| 82 |
); |
80 |
); |
| 83 |
|
81 |
|
|
Lines 95-114
subtest 'Test Koha::Patrons::merge' => sub {
Link Here
|
| 95 |
object => $keeper->id |
93 |
object => $keeper->id |
| 96 |
}, |
94 |
}, |
| 97 |
{ order_by => { -desc => "timestamp" } } |
95 |
{ order_by => { -desc => "timestamp" } } |
| 98 |
)->unblessed; |
|
|
| 99 |
|
| 100 |
$info_log = $log->[0]{info}; |
| 101 |
|
| 102 |
is( |
| 103 |
$info_log, undef, |
| 104 |
"GetLogs didn't returns results in the log viewer for the merge of " . $borrower3->{borrowernumber} |
| 105 |
); |
96 |
); |
| 106 |
|
97 |
|
| 107 |
$info_log = $log->[1]{info}; |
|
|
| 108 |
|
| 109 |
is( |
98 |
is( |
| 110 |
$info_log, undef, |
99 |
$log->count, 0, |
| 111 |
"GetLogs didn't returns results in the log viewer for the merge of " . $borrower4->{borrowernumber} |
100 |
"GetLogs didn't log anything" |
| 112 |
); |
101 |
); |
| 113 |
}; |
102 |
}; |
| 114 |
|
103 |
|
| 115 |
- |
|
|