Lines 115-126
subtest 'Koha::Exceptions::Metadata tests' => sub {
Link Here
|
115 |
$object->mock( 'schema', 'a_schema' ); |
115 |
$object->mock( 'schema', 'a_schema' ); |
116 |
|
116 |
|
117 |
throws_ok |
117 |
throws_ok |
118 |
{ Koha::Exceptions::Metadata::Invalid->throw( id => 'an_id', format => 'a_format', schema => 'a_schema' ); } |
118 |
{ Koha::Exceptions::Metadata::Invalid->throw( |
|
|
119 |
id => 'an_id', format => 'a_format', |
120 |
schema => 'a_schema', decoding_error => 'a_nasty_error' ); } |
119 |
'Koha::Exceptions::Metadata::Invalid', |
121 |
'Koha::Exceptions::Metadata::Invalid', |
120 |
'Exception is thrown :-D'; |
122 |
'Exception is thrown :-D'; |
121 |
|
123 |
|
122 |
# stringify the exception |
124 |
# stringify the exception |
123 |
is( "$@", 'Invalid data, cannot decode object (id=an_id, format=a_format, schema=a_schema)', 'Exception stringified correctly' ); |
125 |
is( "$@", 'Invalid data, cannot decode object (id=an_id, format=a_format, schema=a_schema, decoding_error=\'a_nasty_error\')', 'Exception stringified correctly' ); |
124 |
|
126 |
|
125 |
throws_ok |
127 |
throws_ok |
126 |
{ Koha::Exceptions::Metadata::Invalid->throw( "Manual message exception" ) } |
128 |
{ Koha::Exceptions::Metadata::Invalid->throw( "Manual message exception" ) } |
127 |
- |
|
|