From ad8d063ffae574a050a0cdc54dcdf26b23df1350 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 9 Feb 2016 13:40:01 +0000 Subject: [PATCH] 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 slashifyDate removed, all test pass successfully Signed-off-by: Marcel de Rooy Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com --- C4/Koha.pm | 18 ------------------ t/Koha.t | 9 +-------- t/db_dependent/Koha.t | 13 +++---------- 3 files changed, 4 insertions(+), 36 deletions(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index dce3c63a6f..6e8ba35702 100644 --- a/C4/Koha.pm +++ b/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 @@ -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) = @_; diff --git a/t/Koha.t b/t/Koha.t index 364020d18d..366a21b6ba 100755 --- a/t/Koha.t +++ b/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{'"&<>'}; diff --git a/t/db_dependent/Koha.t b/t/db_dependent/Koha.t index fe6d642cbd..6baae5c8e2 100644 --- a/t/db_dependent/Koha.t +++ b/t/db_dependent/Koha.t @@ -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( -- 2.39.5