Lines 63-69
subtest 'Config does not exist' => sub {
Link Here
|
63 |
|
63 |
|
64 |
subtest 'Koha::Anonymized::Patrons tests' => sub { |
64 |
subtest 'Koha::Anonymized::Patrons tests' => sub { |
65 |
|
65 |
|
66 |
plan tests => 9; |
66 |
plan tests => 10; |
67 |
|
67 |
|
68 |
$schema->storage->txn_begin; |
68 |
$schema->storage->txn_begin; |
69 |
|
69 |
|
Lines 98-103
subtest 'Koha::Anonymized::Patrons tests' => sub {
Link Here
|
98 |
is( $patron->sort1, "another sort1", "correctly updated" ); |
98 |
is( $patron->sort1, "another sort1", "correctly updated" ); |
99 |
$patron->delete; |
99 |
$patron->delete; |
100 |
|
100 |
|
|
|
101 |
subtest 'Patron was created before the Pseudonymization was actived' => sub { |
102 |
|
103 |
plan tests => 2; |
104 |
|
105 |
t::lib::Mocks::mock_preference( 'Pseudonymization', 0 ); |
106 |
my $patron = Koha::Patron->new($patron_info)->store; |
107 |
$patron->discard_changes; |
108 |
|
109 |
t::lib::Mocks::mock_preference( 'Pseudonymization', 1 ); |
110 |
$patron->sort1("another sort1")->store; |
111 |
$anonymized = Koha::Anonymized::Patrons->find_from_borrowernumber( $patron->borrowernumber ); |
112 |
is( $anonymized->sort1, "another sort1", "correctly updated" ); |
113 |
$anonymized->delete; |
114 |
|
115 |
my $item = $builder->build_sample_item; |
116 |
t::lib::Mocks::mock_userenv({ branchcode => $item->homebranch }); |
117 |
AddIssue( $patron->unblessed, $item->barcode, dt_from_string ); |
118 |
AddReturn( $item->barcode, $item->homebranch, undef, dt_from_string ); |
119 |
$anonymized = Koha::Anonymized::Transactions->search( { itemnumber => $item->itemnumber } )->next; |
120 |
like( $anonymized->hashed_borrowernumber, |
121 |
qr{^\$2a\$08\$}, "The hashed_borrowernumber has been created (and so the corresponding anonymized_borrowers entry)" ); |
122 |
|
123 |
$patron->delete; |
124 |
}; |
125 |
|
101 |
$schema->storage->txn_rollback; |
126 |
$schema->storage->txn_rollback; |
102 |
}; |
127 |
}; |
103 |
|
128 |
|
104 |
- |
|
|