View | Details | Raw Unified | Return to bug 21597
Collapse All | Expand All

(-)a/t/db_dependent/Koha/ApiKeys.t (-1 / +1 lines)
Lines 80-86 subtest 'store() tests' => sub { Link Here
80
    $patron_to_delete->delete;
80
    $patron_to_delete->delete;
81
81
82
    throws_ok
82
    throws_ok
83
        { Koha::ApiKey->new({ patron_id => $deleted_id })->store }
83
        { Koha::ApiKey->new({ patron_id => $deleted_id, description => 'a description' })->store }
84
        'Koha::Exceptions::Object::FKConstraint',
84
        'Koha::Exceptions::Object::FKConstraint',
85
        'Invalid patron ID raises exception';
85
        'Invalid patron ID raises exception';
86
    is( $@->message,   'Broken FK constraint', 'Exception message is correct' );
86
    is( $@->message,   'Broken FK constraint', 'Exception message is correct' );
(-)a/t/db_dependent/Koha/Object.t (-2 / +2 lines)
Lines 253-259 subtest 'store() tests' => sub { Link Here
253
    my $patron_id = $patron->id;
253
    my $patron_id = $patron->id;
254
    $patron->delete;
254
    $patron->delete;
255
255
256
    my $api_key = Koha::ApiKey->new({ patron_id => $patron_id });
256
    my $api_key = Koha::ApiKey->new({ patron_id => $patron_id, secret => 'a secret', description => 'a description' });
257
257
258
    my $print_error = $schema->storage->dbh->{PrintError};
258
    my $print_error = $schema->storage->dbh->{PrintError};
259
    $schema->storage->dbh->{PrintError} = 0;
259
    $schema->storage->dbh->{PrintError} = 0;
Lines 278-283 subtest 'store() tests' => sub { Link Here
278
    my $new_api_key = Koha::ApiKey->new({
278
    my $new_api_key = Koha::ApiKey->new({
279
        patron_id => $patron_id,
279
        patron_id => $patron_id,
280
        secret => $api_key->secret,
280
        secret => $api_key->secret,
281
        description => 'a description',
281
    });
282
    });
282
283
283
    throws_ok
284
    throws_ok
284
- 

Return to bug 21597