|
Lines 35-41
my $uuid_gen_secret_counter = 0;
Link Here
|
| 35 |
|
35 |
|
| 36 |
subtest 'store() tests' => sub { |
36 |
subtest 'store() tests' => sub { |
| 37 |
|
37 |
|
| 38 |
plan tests => 9; |
38 |
plan tests => 13; |
| 39 |
|
39 |
|
| 40 |
$schema->storage->txn_begin; |
40 |
$schema->storage->txn_begin; |
| 41 |
|
41 |
|
|
Lines 65-70
subtest 'store() tests' => sub {
Link Here
|
| 65 |
is( $api_key->description, $description, 'Description is correctly stored' ); |
65 |
is( $api_key->description, $description, 'Description is correctly stored' ); |
| 66 |
is( $api_key->active, 1, 'Key is active by default' ); |
66 |
is( $api_key->active, 1, 'Key is active by default' ); |
| 67 |
|
67 |
|
|
|
68 |
# revoke, to call store |
| 69 |
my $original_api_key = $api_key->unblessed; |
| 70 |
$api_key->active(0)->store; |
| 71 |
$api_key->discard_changes; |
| 72 |
|
| 73 |
is( $api_key->client_id, $original_api_key->{client_id}, '->store() preserves the client_id' ); |
| 74 |
is( $api_key->secret, $original_api_key->{secret}, '->store() preserves the secret' ); |
| 75 |
is( $api_key->patron_id, $original_api_key->{patron_id}, '->store() preserves the patron_id' ); |
| 76 |
is( $api_key->active, 0, '->store() preserves the active value' ); |
| 77 |
|
| 68 |
my $patron_to_delete = $builder->build_object( { class => 'Koha::Patrons' } ); |
78 |
my $patron_to_delete = $builder->build_object( { class => 'Koha::Patrons' } ); |
| 69 |
my $deleted_id = $patron_to_delete->id; |
79 |
my $deleted_id = $patron_to_delete->id; |
| 70 |
$patron_to_delete->delete; |
80 |
$patron_to_delete->delete; |
| 71 |
- |
|
|