Bugzilla – Attachment 8264 Details for
Bug 7310
Improving permissions on lists (virtual shelves)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7310 Part 6: VirtualShelves unit test
0006-Bug-7310-Updated-VirtualShelves-unit-test.patch (text/plain), 2.80 KB, created by
Ian Walls
on 2012-03-19 12:00:23 UTC
(
hide
)
Description:
Bug 7310 Part 6: VirtualShelves unit test
Filename:
MIME Type:
Creator:
Ian Walls
Created:
2012-03-19 12:00:23 UTC
Size:
2.80 KB
patch
obsolete
>From 521d25859bac095915e09c242e2adf06dc0616cc Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 20 Feb 2012 10:53:25 +0100 >Subject: [PATCH 6/9] Bug 7310: Updated VirtualShelves unit test > >Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> >Signed-off-by: Ian Walls <koha.sekjal@gmail.com> >--- > t/db_dependent/VirtualShelves.t | 15 ++++++++------- > 1 files changed, 8 insertions(+), 7 deletions(-) > >diff --git a/t/db_dependent/VirtualShelves.t b/t/db_dependent/VirtualShelves.t >index a50f81e..a0ac90e 100755 >--- a/t/db_dependent/VirtualShelves.t >+++ b/t/db_dependent/VirtualShelves.t >@@ -9,7 +9,7 @@ use strict; > use warnings; > use C4::Context; > >-use Test::More tests => 92; >+use Test::More tests => 82; > > # Getting some borrowers from database. > my $dbh = C4::Context->dbh; >@@ -66,7 +66,8 @@ use_ok('C4::VirtualShelves'); > # creating 10 good shelves. > my @shelves; > for(my $i=0; $i<10;$i++){ >- my $ShelfNumber = AddShelf("Shelf_".$i,$borrowers[$i] || '',int(rand(3))+1); >+ my $ShelfNumber = AddShelf( >+ {shelfname=>"Shelf_".$i, category=>int(rand(2))+1 }, $borrowers[$i] ); > die "test Not ok, remove some shelves before" if ($ShelfNumber == -1); > ok($ShelfNumber > -1, "created shelf"); # Shelf creation successful; > push @shelves, $ShelfNumber if $ShelfNumber > -1; >@@ -76,7 +77,9 @@ ok(10 == scalar @shelves, 'created 10 lists'); # 10 shelves in @shelves; > > # try to create some shelf which already exists. > for(my $i=0;$i<10;$i++){ >- my $badNumShelf = AddShelf("Shelf_".$i,$borrowers[$i] || '',''); >+ my @shlf=GetShelf($shelves[$i]); >+ my $badNumShelf = AddShelf( >+ {shelfname=>"Shelf_".$i, category=>$shlf[3] }, $borrowers[$i]); > ok(-1 == $badNumShelf, 'do not create lists with duplicate names'); # AddShelf returns -1 if name already exist. > } > >@@ -94,7 +97,7 @@ for(my $i=0; $i<10;$i++){ > my $should_fail = exists($used{$key}) ? 1 : 0; > > my ($biblistBefore,$countbefore) = GetShelfContents($shelfnumber); >- my $status = AddToShelf($bib,$shelfnumber); >+ my $status = AddToShelf($bib,$shelfnumber,$borrowers[$i]); > my ($biblistAfter,$countafter) = GetShelfContents($shelfnumber); > > if ($should_fail) { >@@ -121,15 +124,13 @@ for(my $i=0; $i<10;$i++){ > my $rand = int(rand(9)); > my $numA = $shelves[$rand]; > my $shelf = { shelfname => "NewName_".$rand, >- owner => $borrowers[$rand], >- category => int(rand(3))+1 }; >+ category => int(rand(2))+1 }; > > ModShelf($numA,$shelf); > my ($numB,$nameB,$ownerB,$categoryB) = GetShelf($numA); > > ok($numA == $numB, 'modified shelf'); > ok($shelf->{shelfname} eq $nameB, '... and name change took'); >- ok($shelf->{owner} eq $ownerB, '... and owner change took'); > ok($shelf->{category} eq $categoryB, '... and category change took'); > } > >-- >1.7.0.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 7310
:
7092
|
7678
|
7679
|
7680
|
7681
|
7682
|
7769
|
7819
|
7820
|
7821
|
7823
|
7824
|
7825
|
7828
|
7873
|
7874
|
7875
|
7876
|
7877
|
7878
|
7879
|
7909
|
7910
|
7925
|
7926
|
7939
|
7940
|
7942
|
7953
|
8006
|
8007
|
8008
|
8009
|
8259
|
8260
|
8261
|
8262
|
8263
| 8264 |
8265
|
8266
|
8267
|
8410
|
8411
|
8412
|
8467
|
8519