Bug 26171: adapt Koha/Exceptions.t
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c961b238a2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
c097e91254
commit
17f9ebdb66
|
|
@ -111,18 +111,19 @@ subtest 'Koha::Exceptions::Metadata tests' => sub {
|
|||
|
||||
my $object = Test::MockObject->new;
|
||||
$object->mock( 'id', 'an_id' );
|
||||
$object->mock( 'biblionumber', 'a_biblionumber' );
|
||||
$object->mock( 'format', 'a_format' );
|
||||
$object->mock( 'schema', 'a_schema' );
|
||||
|
||||
throws_ok
|
||||
{ Koha::Exceptions::Metadata::Invalid->throw(
|
||||
id => 'an_id', format => 'a_format',
|
||||
id => 'an_id', biblionumber => 'a_biblionumber', format => 'a_format',
|
||||
schema => 'a_schema', decoding_error => 'a_nasty_error' ); }
|
||||
'Koha::Exceptions::Metadata::Invalid',
|
||||
'Exception is thrown :-D';
|
||||
|
||||
# stringify the exception
|
||||
is( "$@", 'Invalid data, cannot decode object (id=an_id, format=a_format, schema=a_schema, decoding_error=\'a_nasty_error\')', 'Exception stringified correctly' );
|
||||
is( "$@", 'Invalid data, cannot decode object (id=an_id, biblionumber=a_biblionumber, format=a_format, schema=a_schema, decoding_error=\'a_nasty_error\')', 'Exception stringified correctly' );
|
||||
|
||||
throws_ok
|
||||
{ Koha::Exceptions::Metadata::Invalid->throw( "Manual message exception" ) }
|
||||
|
|
|
|||
Loading…
Reference in New Issue