Lines 64-70
subtest 'Config does not exist' => sub {
Link Here
|
64 |
ccode => $item->ccode, |
64 |
ccode => $item->ccode, |
65 |
} |
65 |
} |
66 |
); |
66 |
); |
67 |
my $pseudo = Koha::PseudonymizedTransaction->new_from_statistic($stat); |
67 |
my $pseudo = Koha::PseudonymizedTransaction->create_from_statistic($stat); |
68 |
|
68 |
|
69 |
} catch { |
69 |
} catch { |
70 |
ok( |
70 |
ok( |
Lines 119-125
subtest 'Koha::Anonymized::Transactions tests' => sub {
Link Here
|
119 |
["Called"], "Background job enqueued when pseudonymization enabled"; |
119 |
["Called"], "Background job enqueued when pseudonymization enabled"; |
120 |
|
120 |
|
121 |
my $statistic = Koha::Statistics->search( { itemnumber => $item->itemnumber } )->next; |
121 |
my $statistic = Koha::Statistics->search( { itemnumber => $item->itemnumber } )->next; |
122 |
my $pseudonymized = Koha::PseudonymizedTransaction->new_from_statistic($statistic); |
122 |
my $pseudonymized = Koha::PseudonymizedTransaction->create_from_statistic($statistic); |
123 |
like( |
123 |
like( |
124 |
$pseudonymized->hashed_borrowernumber, |
124 |
$pseudonymized->hashed_borrowernumber, |
125 |
qr{^\$2a\$08\$}, "The hashed_borrowernumber must be a bcrypt hash" |
125 |
qr{^\$2a\$08\$}, "The hashed_borrowernumber must be a bcrypt hash" |
Lines 135-141
subtest 'Koha::Anonymized::Transactions tests' => sub {
Link Here
|
135 |
is( $pseudonymized->itemcallnumber, $item->itemcallnumber, 'itemcallnumber copied correctly' ); |
135 |
is( $pseudonymized->itemcallnumber, $item->itemcallnumber, 'itemcallnumber copied correctly' ); |
136 |
is( $pseudonymized->ccode, $item->ccode, 'ccode copied correctly' ); |
136 |
is( $pseudonymized->ccode, $item->ccode, 'ccode copied correctly' ); |
137 |
|
137 |
|
138 |
my $next_p = Koha::PseudonymizedTransaction->new_from_statistic($statistic); |
138 |
my $next_p = Koha::PseudonymizedTransaction->create_from_statistic($statistic); |
139 |
|
139 |
|
140 |
isnt( |
140 |
isnt( |
141 |
$pseudonymized->id, |
141 |
$pseudonymized->id, |
Lines 223-229
subtest 'PseudonymizedBorrowerAttributes tests' => sub {
Link Here
|
223 |
} |
223 |
} |
224 |
); |
224 |
); |
225 |
|
225 |
|
226 |
my $p = Koha::PseudonymizedTransaction->new_from_statistic($statistic); |
226 |
my $p = Koha::PseudonymizedTransaction->create_from_statistic($statistic); |
227 |
my $attributes = |
227 |
my $attributes = |
228 |
Koha::Database->new->schema->resultset('PseudonymizedBorrowerAttribute') |
228 |
Koha::Database->new->schema->resultset('PseudonymizedBorrowerAttribute') |
229 |
->search( { transaction_id => $p->id }, { order_by => 'attribute' } ); |
229 |
->search( { transaction_id => $p->id }, { order_by => 'attribute' } ); |
Lines 258-264
subtest 'PseudonymizedBorrowerAttributes tests' => sub {
Link Here
|
258 |
} |
258 |
} |
259 |
); |
259 |
); |
260 |
|
260 |
|
261 |
my $next_p = Koha::PseudonymizedTransaction->new_from_statistic($second_statistic); |
261 |
my $next_p = Koha::PseudonymizedTransaction->create_from_statistic($second_statistic); |
262 |
my $next_attributes = |
262 |
my $next_attributes = |
263 |
Koha::Database->new->schema->resultset('PseudonymizedBorrowerAttribute') |
263 |
Koha::Database->new->schema->resultset('PseudonymizedBorrowerAttribute') |
264 |
->search( { transaction_id => $next_p->id }, { order_by => 'attribute' } ); |
264 |
->search( { transaction_id => $next_p->id }, { order_by => 'attribute' } ); |