Bugzilla – Attachment 51650 Details for
Bug 16550
Can't set opac news expiration date to NULL, it reverts to today
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16550: Add test to NewsChannels.t
Bug-16550-Add-test-to-NewsChannelst.patch (text/plain), 2.72 KB, created by
Marc Véron
on 2016-05-20 12:50:45 UTC
(
hide
)
Description:
Bug 16550: Add test to NewsChannels.t
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2016-05-20 12:50:45 UTC
Size:
2.72 KB
patch
obsolete
>From 02d1328b12c0494367992498fea29ba15423cf7a Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Fri, 20 May 2016 14:42:08 +0200 >Subject: [PATCH] Bug 16550: Add test to NewsChannels.t > >To test: Run t/db_dependent/NewsChannels.t > >Tests adding and retreiving a news item without expiration date. >This test should fail without patch for Bug 16550 and pass OK with patch. >--- > t/db_dependent/NewsChannels.t | 27 ++++++++++++++++++++++++++- > 1 file changed, 26 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/NewsChannels.t b/t/db_dependent/NewsChannels.t >index 2f38c78..e5d7515 100644 >--- a/t/db_dependent/NewsChannels.t >+++ b/t/db_dependent/NewsChannels.t >@@ -4,7 +4,7 @@ use Modern::Perl; > use C4::Branch qw(GetBranchName); > use Koha::DateUtils; > >-use Test::More tests => 12; >+use Test::More tests => 14; > > BEGIN { > use_ok('C4::NewsChannels'); >@@ -69,6 +69,7 @@ ok( $rv == 0, 'Correctly failed on no parameter!' ); > > my $timestamp = '2000-01-01'; > my ( $timestamp1, $timestamp2 ) = ( $timestamp, $timestamp ); >+my $timestamp3 = '2000-01-02'; > my ( $title1, $new1, $lang1, $expirationdate1, $number1 ) = > ( 'News Title', '<p>We have some exciting news!</p>', q{}, '2999-12-30', 1 ); > my $href_entry1 = { >@@ -99,6 +100,20 @@ my $href_entry2 = { > $rv = add_opac_new($href_entry2); > ok( $rv == 1, 'Successfully added the second dummy news item!' ); > >+my ( $title3, $new3, $lang3, $number3 ) = >+ ( 'News Title3', '<p>News without expiration date</p>', q{}, 1 ); >+my $href_entry3 = { >+ title => $title3, >+ new => $new3, >+ lang => $lang3, >+ timestamp => $timestamp3, >+ number => $number3, >+ borrowernumber => $brwrnmbr, >+ branchcode => 'LIB1', >+}; >+$rv = add_opac_new($href_entry3); >+ok( $rv == 1, 'Successfully added the third dummy news item without expiration date!' ); >+ > # We need to determine the idnew in a non-MySQLism way. > # This should be good enough. > my $query = >@@ -112,6 +127,12 @@ $sth = $dbh->prepare($query); > $sth->execute(); > my $idnew2 = $sth->fetchrow; > >+$query = >+q{ SELECT idnew from opac_news WHERE timestamp='2000-01-02'; }; >+$sth = $dbh->prepare($query); >+$sth->execute(); >+my $idnew3 = $sth->fetchrow; >+ > # Test upd_opac_new > $rv = upd_opac_new(); # intentionally bad parmeters > ok( $rv == 0, 'Correctly failed on no parameter!' ); >@@ -169,6 +190,10 @@ is_deeply( > 'got back expected news item via get_opac_new - ID 2' > ); > >+# Test get_opac_new (single news item without expiration date) >+my $news3 = get_opac_new($idnew3); >+ok (! $news3->{ expirationdate }, "Expiration date should be empty"); >+ > # Test get_opac_news (multiple news items) > my ( $opac_news_count, $arrayref_opac_news ) = get_opac_news( 0, q{}, 'LIB1' ); > >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16550
:
51642
|
51650
|
51655
|
51656
|
51668
|
51669
|
51670