http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9593
--- Comment #51 from Koha Team Lyon 3 <[email protected]> --- I know very few about unit test. Would something like that do the trick ? #!/usr/bin/perl use strict; use warnings; use C4::Biblio; use Test::More tests=>1; # start transaction my $dbh = C4::Context->dbh; $dbh->{AutoCommit} = 0; $dbh->{RaiseError} = 1; # set a test price string my $PRICE_STRING='25.5 EUR, $32, $LD35'; my $expectedout='32'; # set active currency test data my $CURRENCY = 'TEST'; my $SYMBOL = '$'; my $ISOCODE = 'USD'; my $RATE= 1; # disables existing active currency if necessary. my $active_currency = C4::Budgets->GetCurrency(); my $curr; if ($active_currency) { $curr = $active_currency->{'currency'}; $dbh->do("UPDATE currency set active = 0 where currency = '$curr'"); } $dbh->do("INSERT INTO currency ( currency,symbol,isocode,rate,active ) VALUES ('$CURRENCY','$SYMBOL','$ISOCODE','$RATE',1)"); my $mungemarcprice=MungeMarcPrice($PRICE_STRING); ok ($mungemarcprice eq $expectedout, "MungeMarcPrice returned $expectedout as expected"); # Cleanup $dbh->rollback; Olivier Crouzet -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
