@@ -, +, @@ git grep slashifyDate prove t/Koha.t prove t/db_dependent/Koha.t --- C4/Koha.pm | 18 ------------------ t/Koha.t | 9 +-------- t/db_dependent/Koha.t | 13 +++---------- 3 files changed, 4 insertions(+), 36 deletions(-) --- a/C4/Koha.pm +++ a/C4/Koha.pm @@ -39,7 +39,6 @@ BEGIN { require Exporter; @ISA = qw(Exporter); @EXPORT = qw( - &slashifyDate &subfield_is_koha_internal_p &GetPrinters &GetPrinter &GetItemTypes &getitemtypeinfo @@ -100,23 +99,6 @@ Koha.pm provides many functions for Koha scripts. =cut -=head2 slashifyDate - - $slash_date = &slashifyDate($dash_date); - -Takes a string of the form "DD-MM-YYYY" (or anything separated by -dashes), converts it to the form "YYYY/MM/DD", and returns the result. - -=cut - -sub slashifyDate { - - # accepts a date of the form xx-xx-xx[xx] and returns it in the - # form xx/xx/xx[xx] - my @dateOut = split( '-', shift ); - return ("$dateOut[2]/$dateOut[1]/$dateOut[0]"); -} - # FIXME.. this should be moved to a MARC-specific module sub subfield_is_koha_internal_p { my ($subfield) = @_; --- a/t/Koha.t +++ a/t/Koha.t @@ -25,7 +25,7 @@ use Module::Load::Conditional qw/check_install/; BEGIN { if ( check_install( module => 'Test::DBIx::Class' ) ) { - plan tests => 34; + plan tests => 33; } else { plan skip_all => "Need Test::DBIx::Class" } @@ -63,18 +63,11 @@ is ( IsAuthorisedValueCategory('LOC'), 1, 'LOC is a valid authorized value categ is ( IsAuthorisedValueCategory('something'), 0, 'something is not a valid authorized value category'); is ( IsAuthorisedValueCategory('RELTERMS'), 1, 'RELTERMS is a valid authorized value category'); -# -# test that &slashifyDate returns correct (non-US) date -# -my $date = "01/01/2002"; -my $newdate = &slashifyDate("2002-01-01"); my $isbn13 = "9780330356473"; my $isbn13D = "978-0-330-35647-3"; my $isbn10 = "033035647X"; my $isbn10D = "0-330-35647-X"; -ok($date eq $newdate, 'slashifyDate'); - my $undef = undef; is(xml_escape($undef), '', 'xml_escape() returns empty string on undef input'); my $str = q{'"&<>'}; --- a/t/db_dependent/Koha.t +++ a/t/db_dependent/Koha.t @@ -204,21 +204,14 @@ $dbh->do($sql); } -# -# test that &slashifyDate returns correct (non-US) date -# -subtest 'Date and ISBN tests' => sub { - plan tests => 7; +subtest 'ISBN tests' => sub { + plan tests => 6; - my $date = "01/01/2002"; - my $newdate = &slashifyDate("2002-01-01"); my $isbn13 = "9780330356473"; my $isbn13D = "978-0-330-35647-3"; my $isbn10 = "033035647X"; my $isbn10D = "0-330-35647-X"; - ok( $date eq $newdate, 'slashifyDate' ); - my $undef = undef; - is( xml_escape($undef), '', + is( xml_escape(undef), '', 'xml_escape() returns empty string on undef input' ); my $str = q{'"&<>'}; is( --