Bug 15769: Remove outdated C4::Koha::slashifyDate subroutine

This subroutine does not make sense anymore (Koha::DateUtils should be
used) and is no longer used.
It can be removed safely.

Test plan:
  git grep slashifyDate
should not return any results

  prove t/Koha.t
and
  prove t/db_dependent/Koha.t
should return green

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
slashifyDate removed, all test pass successfully

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
This commit is contained in:
Jonathan Druart 2016-02-09 13:40:01 +00:00 committed by Brendan Gallagher
parent 2ea901c641
commit ad8d063ffa
3 changed files with 4 additions and 36 deletions

View File

@ -39,7 +39,6 @@ BEGIN {
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(
&slashifyDate
&subfield_is_koha_internal_p
&GetPrinters &GetPrinter
&GetItemTypes &getitemtypeinfo
@ -97,23 +96,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) = @_;

View File

@ -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{'"&<>'};

View File

@ -233,21 +233,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(