3 # This file is part of Koha.
5 # Koha is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # Koha is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with Koha; if not, see <http://www.gnu.org/licenses>.
20 use Test
::More tests
=> 1;
23 use Koha
::Plugins
::Tab
;
25 subtest
'new() tests' => sub {
28 throws_ok
{ Koha
::Plugins
::Tab
->new( { title
=> 'A title' } ); }
29 'Koha::Exceptions::MissingParameter',
30 'Exception is thrown on missing content';
34 "Mandatory parameter 'content' missing",
35 'Exception message is correct'
38 throws_ok
{ Koha
::Plugins
::Tab
->new( { content
=> 'Some content' } ); }
39 'Koha::Exceptions::MissingParameter',
40 'Exception is thrown on missing title';
44 "Mandatory parameter 'title' missing",
45 'Exception message is correct'
48 my $tab = Koha
::Plugins
::Tab
->new(
51 content
=> 'Some content'
55 is
( $tab->title, 'A title', 'title accessor is correct' );
56 is
( $tab->content, 'Some content', 'content accessor is correct' );
58 my $id = 'calculated-id';
61 is
( $tab->id, $id, 'The id can be calculated and set on runtime' );