Bug 11630: (QA Followup) Move code to subroutine, add unit tests
[koha.git] / t / db_dependent / Circulation / AgeRestrictionMarkers.t
1 use Modern::Perl;
2 use Test::More tests => 4;
3
4 use C4::Context;
5 use C4::Circulation;
6
7 my $dbh = C4::Context->dbh;
8 $dbh->{AutoCommit} = 0;
9 $dbh->{RaiseError} = 1;
10
11 C4::Context->set_preference( 'AgeRestrictionMarker', 'FSK|PEGI|Age|K' );
12
13 is ( C4::Circulation::GetAgeRestriction('FSK 16'), '16', 'FSK 16 returns 16' );
14 is ( C4::Circulation::GetAgeRestriction('PEGI 16'), '16', 'PEGI 16 returns 16' );
15 is ( C4::Circulation::GetAgeRestriction('Age 16'), '16', 'Age 16 returns 16' );
16 is ( C4::Circulation::GetAgeRestriction('K16'), '16', 'K16 returns 16' );
17