Lines 133-139
subtest 'store( extended_attributes ) tests' => sub {
Link Here
|
133 |
|
133 |
|
134 |
subtest 'approve tests' => sub { |
134 |
subtest 'approve tests' => sub { |
135 |
|
135 |
|
136 |
plan tests => 18; |
136 |
plan tests => 20; |
137 |
|
137 |
|
138 |
$schema->storage->txn_begin; |
138 |
$schema->storage->txn_begin; |
139 |
|
139 |
|
Lines 148-154
subtest 'approve tests' => sub {
Link Here
|
148 |
); |
148 |
); |
149 |
my $verification_token = md5_hex( time().{}.rand().{}.$$ ); |
149 |
my $verification_token = md5_hex( time().{}.rand().{}.$$ ); |
150 |
my $valid_json_text |
150 |
my $valid_json_text |
151 |
= '[{"code":"CODE_1","value":"VALUE_1"},{"code":"CODE_2","value":"VALUE_2"}]'; |
151 |
= '[{"code":"CODE_1","value":"VALUE_1"},{"code":"CODE_2","value":0}]'; |
152 |
my $patron_modification = Koha::Patron::Modification->new( |
152 |
my $patron_modification = Koha::Patron::Modification->new( |
153 |
{ borrowernumber => $patron_hashref->{borrowernumber}, |
153 |
{ borrowernumber => $patron_hashref->{borrowernumber}, |
154 |
firstname => 'Kyle', |
154 |
firstname => 'Kyle', |
Lines 172-177
subtest 'approve tests' => sub {
Link Here
|
172 |
'CODE_1', 'Patron modification correctly saved attribute code' ); |
172 |
'CODE_1', 'Patron modification correctly saved attribute code' ); |
173 |
is( $patron_attributes[0][0]->{value}, |
173 |
is( $patron_attributes[0][0]->{value}, |
174 |
'VALUE_1', 'Patron modification correctly saved attribute value' ); |
174 |
'VALUE_1', 'Patron modification correctly saved attribute value' ); |
|
|
175 |
is( $patron_attributes[0][1]->{code}, |
176 |
'CODE_2', 'Patron modification correctly saved attribute code' ); |
177 |
is( $patron_attributes[0][1]->{value}, |
178 |
0, 'Patron modification correctly saved attribute with value 0, not confused with delete' ); |
175 |
|
179 |
|
176 |
# Create a new Koha::Patron::Modification, skip extended_attributes to |
180 |
# Create a new Koha::Patron::Modification, skip extended_attributes to |
177 |
# bypass checks |
181 |
# bypass checks |
178 |
- |
|
|