Bugzilla – Attachment 18822 Details for
Bug 10441
UT: Testing AddShare in VirtualShelves.t
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10441: Testing AddShare in VirtualShelves.t
Bug-10441-Testing-AddShare-in-VirtualShelvest.patch (text/plain), 2.03 KB, created by
Marcel de Rooy
on 2013-06-10 13:02:38 UTC
(
hide
)
Description:
Bug 10441: Testing AddShare in VirtualShelves.t
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2013-06-10 13:02:38 UTC
Size:
2.03 KB
patch
obsolete
>From 674d29a6586e70b443323846b0fdfb4e8209c67c Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 10 Jun 2013 14:51:55 +0200 >Subject: [PATCH] Bug 10441: Testing AddShare in VirtualShelves.t >Content-Type: text/plain; charset=utf-8 > >Builds upon 10386 and 9032. >Adds a unit test for routine AddShare. > >Test plan: Run the test. All passed? >--- > t/db_dependent/VirtualShelves.t | 27 ++++++++++++++++++++++++++- > 1 files changed, 26 insertions(+), 1 deletions(-) > >diff --git a/t/db_dependent/VirtualShelves.t b/t/db_dependent/VirtualShelves.t >index 563eeca..5675b90 100755 >--- a/t/db_dependent/VirtualShelves.t >+++ b/t/db_dependent/VirtualShelves.t >@@ -5,7 +5,7 @@ > # Larger modifications by Jonathan Druart and Marcel de Rooy > > use Modern::Perl; >-use Test::More tests => 81; >+use Test::More tests => 83; > use MARC::Record; > > use C4::Biblio qw( AddBiblio DelBiblio ); >@@ -173,6 +173,31 @@ for(my $i=0; $i<10;$i++){ > } > } > >+#----------------------- TEST AddShare ----------------------------------------# >+ >+#first count the number of shares in the table; keep in mind that AddShare may >+#delete some expired records while housekeeping >+my $sql_sharecount="select count(*) from virtualshelfshares where DATEDIFF(sharedate, NOW())>0"; >+my $cnt1=$dbh->selectrow_array($sql_sharecount); >+ >+#try to add a share without shelfnumber: should fail >+AddShare(0, 'abcdefghij'); >+my $cnt2=$dbh->selectrow_array($sql_sharecount); >+ok($cnt1 == $cnt2, "Did not add an invalid share record"); >+ >+#add another share: should be okay >+#AddShare assumes that you tested if category==private (so we could actually >+#be doing something illegal here :) >+my $n=$shelves[0]->{number}; >+if($n<0) { >+ ok(1, 'Skip AddShare for shelf -1'); >+} >+else { >+ AddShare($n, 'abcdefghij'); >+ my $cnt3=$dbh->selectrow_array($sql_sharecount); >+ ok(1+$cnt2 == $cnt3, "Added one new share record with invitekey"); >+} >+ > #-----------------------TEST DelShelf & DelFromShelf functions------------------------# > # usage : ($status) = &DelShelf($shelfnumber); > >-- >1.7.7.6
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 10441
:
18822
|
19721
|
19736
|
19936
|
20505