Lines 28-34
BEGIN {
Link Here
|
28 |
|
28 |
|
29 |
subtest 'new() tests' => sub { |
29 |
subtest 'new() tests' => sub { |
30 |
|
30 |
|
31 |
plan tests => 8; |
31 |
plan tests => 11; |
32 |
|
32 |
|
33 |
my $some_error = 'Some error'; |
33 |
my $some_error = 'Some error'; |
34 |
|
34 |
|
Lines 42-47
subtest 'new() tests' => sub {
Link Here
|
42 |
is( $message->message, $some_error, 'The message attribute has the right value' ); |
42 |
is( $message->message, $some_error, 'The message attribute has the right value' ); |
43 |
is( $message->type, 'callback', 'type is correct' ); |
43 |
is( $message->type, 'callback', 'type is correct' ); |
44 |
|
44 |
|
|
|
45 |
$message = Koha::Object::Message->new({ message => $some_error, payload => { some => 'structure' } }); |
46 |
is( ref($message), 'Koha::Object::Message', 'Type is correct' ); |
47 |
is( $message->message, $some_error, 'The message attribute has the right value' ); |
48 |
is_deeply( $message->payload, { some => 'structure' }, 'payload is correct' ); |
49 |
|
45 |
throws_ok |
50 |
throws_ok |
46 |
{ Koha::Object::Message->new({ blah => 'ohh' }); } |
51 |
{ Koha::Object::Message->new({ blah => 'ohh' }); } |
47 |
'Koha::Exceptions::MissingParameter', |
52 |
'Koha::Exceptions::MissingParameter', |
48 |
- |
|
|