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