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

(-)a/t/Koha/Exceptions.t (-2 / +25 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 7;
20
use Test::More tests => 8;
21
use Test::MockObject;
21
use Test::MockObject;
22
use Test::Exception;
22
use Test::Exception;
23
23
Lines 285-287 subtest 'Koha::Exceptions::Patron::Attribute::* tests' => sub { Link Here
285
        'Exception not stringified if manually passed'
285
        'Exception not stringified if manually passed'
286
    );
286
    );
287
};
287
};
288
- 
288
289
subtest 'Koha::Exceptions::Patron tests' => sub {
290
291
    plan tests => 5;
292
293
    use_ok("Koha::Exceptions::Patron");
294
295
    my $type = 'yahey';
296
297
    throws_ok
298
        { Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute->throw(
299
            type => $type ); }
300
        'Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute',
301
        'Exception is thrown :-D';
302
303
    # stringify the exception
304
    is( "$@", "Missing mandatory extended attribute (type=$type)", 'Exception stringified correctly' );
305
306
    throws_ok
307
        { Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute->throw( "Manual message exception" ) }
308
        'Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute',
309
        'Exception is thrown :-D';
310
    is( "$@", 'Manual message exception', 'Exception not stringified if manually passed' );
311
};

Return to bug 28056