From 8f5470aba3c2cbcfc83059222422723531aa32b8 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 16 Apr 2014 12:46:36 +0200 Subject: [PATCH] Bug 11630: Unit tests can be independent of DB Signed-off-by: Jonathan Druart --- t/{db_dependent => }/Circulation/AgeRestrictionMarkers.t | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) rename t/{db_dependent => }/Circulation/AgeRestrictionMarkers.t (64%) diff --git a/t/db_dependent/Circulation/AgeRestrictionMarkers.t b/t/Circulation/AgeRestrictionMarkers.t similarity index 64% rename from t/db_dependent/Circulation/AgeRestrictionMarkers.t rename to t/Circulation/AgeRestrictionMarkers.t index c06776a..619e4ea 100644 --- a/t/db_dependent/Circulation/AgeRestrictionMarkers.t +++ b/t/Circulation/AgeRestrictionMarkers.t @@ -1,17 +1,15 @@ use Modern::Perl; -use Test::More tests => 4; +use Test::More tests => 5; -use C4::Context; -use C4::Circulation; +use t::lib::Mocks; -my $dbh = C4::Context->dbh; -$dbh->{AutoCommit} = 0; -$dbh->{RaiseError} = 1; +use C4::Circulation; -C4::Context->set_preference( 'AgeRestrictionMarker', 'FSK|PEGI|Age|K' ); +t::lib::Mocks::mock_preference( 'AgeRestrictionMarker', 'FSK|PEGI|Age|K' ); is ( C4::Circulation::GetAgeRestriction('FSK 16'), '16', 'FSK 16 returns 16' ); is ( C4::Circulation::GetAgeRestriction('PEGI 16'), '16', 'PEGI 16 returns 16' ); +is ( C4::Circulation::GetAgeRestriction('PEGI16'), '16', 'PEGI16 returns 16' ); is ( C4::Circulation::GetAgeRestriction('Age 16'), '16', 'Age 16 returns 16' ); is ( C4::Circulation::GetAgeRestriction('K16'), '16', 'K16 returns 16' ); -- 1.7.10.4