Lines 148-154
subtest 'Koha::Anonymized::Transactions tests' => sub {
Link Here
|
148 |
|
148 |
|
149 |
subtest 'PseudonymizedMetadataValues tests' => sub { |
149 |
subtest 'PseudonymizedMetadataValues tests' => sub { |
150 |
|
150 |
|
151 |
plan tests => 5; |
151 |
plan tests => 7; |
152 |
|
152 |
|
153 |
$schema->storage->txn_begin; |
153 |
$schema->storage->txn_begin; |
154 |
|
154 |
|
Lines 275-279
subtest 'PseudonymizedMetadataValues tests' => sub {
Link Here
|
275 |
'The id of the 2nd pseudonymized transaction should be different' |
275 |
'The id of the 2nd pseudonymized transaction should be different' |
276 |
); |
276 |
); |
277 |
|
277 |
|
|
|
278 |
my $ill_request = $builder->build_sample_ill_request(); |
279 |
$builder->build( |
280 |
{ |
281 |
source => 'Illrequestattribute', |
282 |
value => { illrequest_id => $ill_request->illrequest_id, type => 'type', value => 'book' } |
283 |
} |
284 |
); |
285 |
|
286 |
my $ill_request_statistic = Koha::Statistic->new( |
287 |
{ |
288 |
type => 'illreq_created', |
289 |
branch => $library->branchcode, |
290 |
itemnumber => undef, |
291 |
borrowernumber => $patron->borrowernumber, |
292 |
itemtype => undef, |
293 |
location => undef, |
294 |
illrequest_id => $ill_request->illrequest_id, |
295 |
ccode => undef, |
296 |
} |
297 |
); |
298 |
|
299 |
my $p2 = Koha::PseudonymizedTransaction->new_from_statistic($ill_request_statistic)->store; |
300 |
|
301 |
my $ill_metadata_values = |
302 |
Koha::Database->new->schema->resultset('PseudonymizedMetadataValue') |
303 |
->search( { transaction_id => $p2->id, tablename => 'illrequestattributes' }, { order_by => 'value' } ); |
304 |
|
305 |
my $ill_metadata_value = $ill_metadata_values->next; |
306 |
|
307 |
is( $ill_metadata_value->key, 'type' ); |
308 |
is( $ill_metadata_value->value, 'book' ); |
309 |
|
278 |
$schema->storage->txn_rollback; |
310 |
$schema->storage->txn_rollback; |
279 |
}; |
311 |
}; |
280 |
- |
|
|