Lines 140-146
subtest 'Koha::Anonymized::Transactions tests' => sub {
Link Here
|
140 |
|
140 |
|
141 |
subtest 'PseudonymizedMetadataValues tests' => sub { |
141 |
subtest 'PseudonymizedMetadataValues tests' => sub { |
142 |
|
142 |
|
143 |
plan tests => 5; |
143 |
plan tests => 7; |
144 |
|
144 |
|
145 |
$schema->storage->txn_begin; |
145 |
$schema->storage->txn_begin; |
146 |
|
146 |
|
Lines 232-236
subtest 'PseudonymizedMetadataValues tests' => sub {
Link Here
|
232 |
is( $attribute_2->value, $attribute_values->[2]->{attribute} ); |
232 |
is( $attribute_2->value, $attribute_values->[2]->{attribute} ); |
233 |
is( $attribute_2->key, $attribute_values->[2]->{code} ); |
233 |
is( $attribute_2->key, $attribute_values->[2]->{code} ); |
234 |
|
234 |
|
|
|
235 |
my $ill_request = $builder->build_sample_ill_request(); |
236 |
$builder->build( |
237 |
{ |
238 |
source => 'Illrequestattribute', |
239 |
value => { illrequest_id => $ill_request->illrequest_id, type => 'type', value => 'book' } |
240 |
} |
241 |
); |
242 |
|
243 |
my $statistic2 = Koha::Statistic->new( |
244 |
{ |
245 |
type => 'ill_request', |
246 |
branch => $library->branchcode, |
247 |
itemnumber => undef, |
248 |
borrowernumber => $patron->borrowernumber, |
249 |
itemtype => undef, |
250 |
location => undef, |
251 |
illrequest_id => $ill_request->illrequest_id, |
252 |
ccode => undef, |
253 |
} |
254 |
); |
255 |
|
256 |
my $p2 = Koha::PseudonymizedTransaction->new_from_statistic($statistic2)->store; |
257 |
|
258 |
my $ill_metadata_values = |
259 |
Koha::Database->new->schema->resultset('PseudonymizedMetadataValue') |
260 |
->search( { transaction_id => $p2->id, tablename => 'illrequestattributes' }, { order_by => 'value' } ); |
261 |
|
262 |
my $ill_metadata_value = $ill_metadata_values->next; |
263 |
|
264 |
is( $ill_metadata_value->key, 'type' ); |
265 |
is( $ill_metadata_value->value, 'book' ); |
266 |
|
235 |
$schema->storage->txn_rollback; |
267 |
$schema->storage->txn_rollback; |
236 |
}; |
268 |
}; |
237 |
- |
|
|