View | Details | Raw Unified | Return to bug 21798
Collapse All | Expand All

(-)a/t/db_dependent/Circulation.t (-9 / +9 lines)
Lines 228-234 C4::Context->dbh->do("DELETE FROM accountlines"); Link Here
228
# CanBookBeRenewed tests
228
# CanBookBeRenewed tests
229
    C4::Context->set_preference('ItemsDeniedRenewal','');
229
    C4::Context->set_preference('ItemsDeniedRenewal','');
230
    # Generate test biblio
230
    # Generate test biblio
231
    my $biblio = $builder->gimme_a_biblio();
231
    my $biblio = $builder->build_sample_biblio();
232
232
233
    my $barcode = 'R00000342';
233
    my $barcode = 'R00000342';
234
    my $branch = $library2->{branchcode};
234
    my $branch = $library2->{branchcode};
Lines 922-928 C4::Context->dbh->do("DELETE FROM accountlines"); Link Here
922
    my $branch   = $library2->{branchcode};
922
    my $branch   = $library2->{branchcode};
923
923
924
    #Create another record
924
    #Create another record
925
    my $biblio2 = $builder->gimme_a_biblio();
925
    my $biblio2 = $builder->build_sample_biblio();
926
926
927
    #Create third item
927
    #Create third item
928
    AddItem(
928
    AddItem(
Lines 1001-1007 C4::Context->dbh->do("DELETE FROM accountlines"); Link Here
1001
    my $barcode  = '1234567890';
1001
    my $barcode  = '1234567890';
1002
    my $branch   = $library2->{branchcode};
1002
    my $branch   = $library2->{branchcode};
1003
1003
1004
    my $biblio = $builder->gimme_a_biblio();
1004
    my $biblio = $builder->build_sample_biblio();
1005
1005
1006
    #Create third item
1006
    #Create third item
1007
    my ( undef, undef, $itemnumber ) = AddItem(
1007
    my ( undef, undef, $itemnumber ) = AddItem(
Lines 1058-1064 C4::Context->dbh->do("DELETE FROM accountlines"); Link Here
1058
        undef,  0,
1058
        undef,  0,
1059
        .10, 1
1059
        .10, 1
1060
    );
1060
    );
1061
    my $biblio = $builder->gimme_a_biblio();
1061
    my $biblio = $builder->build_sample_biblio();
1062
1062
1063
    my $barcode1 = '1234';
1063
    my $barcode1 = '1234';
1064
    my ( undef, undef, $itemnumber1 ) = AddItem(
1064
    my ( undef, undef, $itemnumber1 ) = AddItem(
Lines 1141-1147 C4::Context->dbh->do("DELETE FROM accountlines"); Link Here
1141
    my $branch   = $library->{branchcode};
1141
    my $branch   = $library->{branchcode};
1142
1142
1143
    #Create another record
1143
    #Create another record
1144
    my $biblio = $builder->gimme_a_biblio();
1144
    my $biblio = $builder->build_sample_biblio();
1145
1145
1146
    my (undef, undef, $itemnumber) = AddItem(
1146
    my (undef, undef, $itemnumber) = AddItem(
1147
        {
1147
        {
Lines 1171-1177 C4::Context->dbh->do("DELETE FROM accountlines"); Link Here
1171
{
1171
{
1172
    my $library = $builder->build({ source => 'Branch' });
1172
    my $library = $builder->build({ source => 'Branch' });
1173
1173
1174
    my $biblio = $builder->gimme_a_biblio();
1174
    my $biblio = $builder->build_sample_biblio();
1175
1175
1176
    my $barcode = 'just a barcode';
1176
    my $barcode = 'just a barcode';
1177
    my ( undef, undef, $itemnumber ) = AddItem(
1177
    my ( undef, undef, $itemnumber ) = AddItem(
Lines 1471-1477 subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { Link Here
1471
subtest 'MultipleReserves' => sub {
1471
subtest 'MultipleReserves' => sub {
1472
    plan tests => 3;
1472
    plan tests => 3;
1473
1473
1474
    my $biblio = $builder->gimme_a_biblio();
1474
    my $biblio = $builder->build_sample_biblio();
1475
1475
1476
    my $branch = $library2->{branchcode};
1476
    my $branch = $library2->{branchcode};
1477
1477
Lines 2008-2014 subtest '_FixAccountForLostAndReturned' => sub { Link Here
2008
    );
2008
    );
2009
    my $library = $builder->build_object( { class => 'Koha::Libraries' } );
2009
    my $library = $builder->build_object( { class => 'Koha::Libraries' } );
2010
2010
2011
    my $biblio = $builder->gimme_a_biblio({ author => 'Hall, Daria' });
2011
    my $biblio = $builder->build_sample_biblio({ author => 'Hall, Daria' });
2012
2012
2013
    subtest 'Full write-off tests' => sub {
2013
    subtest 'Full write-off tests' => sub {
2014
2014
Lines 2296-2302 subtest '_FixAccountForLostAndReturned' => sub { Link Here
2296
subtest '_FixOverduesOnReturn' => sub {
2296
subtest '_FixOverduesOnReturn' => sub {
2297
    plan tests => 10;
2297
    plan tests => 10;
2298
2298
2299
    my $biblio = $builder->gimme_a_biblio({ author => 'Hall, Kylie' });
2299
    my $biblio = $builder->build_sample_biblio({ author => 'Hall, Kylie' });
2300
2300
2301
    my $barcode = 'KD987654321';
2301
    my $barcode = 'KD987654321';
2302
    my $branchcode  = $library2->{branchcode};
2302
    my $branchcode  = $library2->{branchcode};
(-)a/t/db_dependent/Holds.t (-11 / +11 lines)
Lines 52-58 $insert_sth->execute('DUMMY'); Link Here
52
$insert_sth->execute('ONLY1');
52
$insert_sth->execute('ONLY1');
53
53
54
# Setup Test------------------------
54
# Setup Test------------------------
55
my $biblio = $builder->gimme_a_biblio({ itemtype => 'DUMMY' });
55
my $biblio = $builder->build_sample_biblio({ itemtype => 'DUMMY' });
56
56
57
# Create item instance for testing.
57
# Create item instance for testing.
58
my ($item_bibnum, $item_bibitemnum, $itemnumber)
58
my ($item_bibnum, $item_bibitemnum, $itemnumber)
Lines 237-243 is( $hold->priority, '6', "Test AlterPriority(), move to bottom" ); Link Here
237
# Note that canreservefromotherbranches has no effect if
237
# Note that canreservefromotherbranches has no effect if
238
# IndependentBranches is OFF.
238
# IndependentBranches is OFF.
239
239
240
my $foreign_biblio = $builder->gimme_a_biblio({ itemtype => 'DUMMY' });
240
my $foreign_biblio = $builder->build_sample_biblio({ itemtype => 'DUMMY' });
241
my ($foreign_item_bibnum, $foreign_item_bibitemnum, $foreign_itemnumber)
241
my ($foreign_item_bibnum, $foreign_item_bibitemnum, $foreign_itemnumber)
242
  = AddItem({ homebranch => $branch_2, holdingbranch => $branch_2 } , $foreign_biblio->biblionumber);
242
  = AddItem({ homebranch => $branch_2, holdingbranch => $branch_2 } , $foreign_biblio->biblionumber);
243
$dbh->do('DELETE FROM issuingrules');
243
$dbh->do('DELETE FROM issuingrules');
Lines 282-288 ok( Link Here
282
282
283
{
283
{
284
    # Regression test for bug 11336 # Test if ModReserve correctly recalculate the priorities
284
    # Regression test for bug 11336 # Test if ModReserve correctly recalculate the priorities
285
    $biblio = $builder->gimme_a_biblio({ itemtype => 'DUMMY' });
285
    $biblio = $builder->build_sample_biblio({ itemtype => 'DUMMY' });
286
    ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $branch_1, holdingbranch => $branch_1 } , $biblio->biblionumber);
286
    ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $branch_1, holdingbranch => $branch_1 } , $biblio->biblionumber);
287
    my $reserveid1 = AddReserve($branch_1, $borrowernumbers[0], $biblio->biblionumber, '', 1);
287
    my $reserveid1 = AddReserve($branch_1, $borrowernumbers[0], $biblio->biblionumber, '', 1);
288
    ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $branch_1, holdingbranch => $branch_1 } , $biblio->biblionumber);
288
    ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $branch_1, holdingbranch => $branch_1 } , $biblio->biblionumber);
Lines 319-325 ok( CanItemBeReserved( $borrowernumbers[0], $itemnumber)->{status} eq 'damaged', Link Here
319
ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for damaged item with AllowHoldsOnDamagedItems disabled" );
319
ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for damaged item with AllowHoldsOnDamagedItems disabled" );
320
320
321
# Regression test for bug 9532
321
# Regression test for bug 9532
322
$biblio = $builder->gimme_a_biblio({ itemtype => 'CANNOT' });
322
$biblio = $builder->build_sample_biblio({ itemtype => 'CANNOT' });
323
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $branch_1, holdingbranch => $branch_1, itype => 'CANNOT' } , $biblio->biblionumber);
323
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $branch_1, holdingbranch => $branch_1, itype => 'CANNOT' } , $biblio->biblionumber);
324
AddReserve(
324
AddReserve(
325
    $branch_1,
325
    $branch_1,
Lines 367-373 $dbh->do(q{ Link Here
367
    INSERT INTO branch_item_rules (branchcode, itemtype, holdallowed, returnbranch)
367
    INSERT INTO branch_item_rules (branchcode, itemtype, holdallowed, returnbranch)
368
    VALUES (?, ?, ?, ?)
368
    VALUES (?, ?, ?, ?)
369
}, {}, $branch_1, 'CAN', 1, 'homebranch');
369
}, {}, $branch_1, 'CAN', 1, 'homebranch');
370
$biblio = $builder->gimme_a_biblio({ itemtype => 'CANNOT' });
370
$biblio = $builder->build_sample_biblio({ itemtype => 'CANNOT' });
371
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem(
371
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem(
372
    { homebranch => $branch_1, holdingbranch => $branch_1, itype => 'CANNOT' } , $biblio->biblionumber);
372
    { homebranch => $branch_1, holdingbranch => $branch_1, itype => 'CANNOT' } , $biblio->biblionumber);
373
is(CanItemBeReserved($borrowernumbers[0], $itemnumber)->{status}, 'notReservable',
373
is(CanItemBeReserved($borrowernumbers[0], $itemnumber)->{status}, 'notReservable',
Lines 393-399 $dbh->do('DELETE FROM issues'); Link Here
393
$dbh->do('DELETE FROM items');
393
$dbh->do('DELETE FROM items');
394
$dbh->do('DELETE FROM biblio');
394
$dbh->do('DELETE FROM biblio');
395
395
396
$biblio = $builder->gimme_a_biblio({ itemtype => 'ONLY1' });
396
$biblio = $builder->build_sample_biblio({ itemtype => 'ONLY1' });
397
( $item_bibnum, $item_bibitemnum, $itemnumber )
397
( $item_bibnum, $item_bibitemnum, $itemnumber )
398
    = AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 }, $biblio->biblionumber );
398
    = AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 }, $biblio->biblionumber );
399
399
Lines 418-424 subtest 'Test max_holds per library/patron category' => sub { Link Here
418
    $dbh->do('DELETE FROM issuingrules');
418
    $dbh->do('DELETE FROM issuingrules');
419
    $dbh->do('DELETE FROM circulation_rules');
419
    $dbh->do('DELETE FROM circulation_rules');
420
420
421
    $biblio = $builder->gimme_a_biblio({ itemtype => 'TEST' });
421
    $biblio = $builder->build_sample_biblio({ itemtype => 'TEST' });
422
    ( $item_bibnum, $item_bibitemnum, $itemnumber ) =
422
    ( $item_bibnum, $item_bibitemnum, $itemnumber ) =
423
      AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 },
423
      AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 },
424
        $biblio->biblionumber );
424
        $biblio->biblionumber );
Lines 488-494 subtest 'Test max_holds per library/patron category' => sub { Link Here
488
subtest 'Pickup location availability tests' => sub {
488
subtest 'Pickup location availability tests' => sub {
489
    plan tests => 3;
489
    plan tests => 3;
490
490
491
    $biblio = $builder->gimme_a_biblio({ itemtype => 'ONLY1' });
491
    $biblio = $builder->build_sample_biblio({ itemtype => 'ONLY1' });
492
    my ( $item_bibnum, $item_bibitemnum, $itemnumber )
492
    my ( $item_bibnum, $item_bibitemnum, $itemnumber )
493
    = AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 }, $biblio->biblionumber );
493
    = AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 }, $biblio->biblionumber );
494
    #Add a default rule to allow some holds
494
    #Add a default rule to allow some holds
Lines 533-553 subtest 'CanItemBeReserved / holds_per_day tests' => sub { Link Here
533
    my $patron   = $builder->build_object( { class => 'Koha::Patrons' } );
533
    my $patron   = $builder->build_object( { class => 'Koha::Patrons' } );
534
534
535
    # Create 3 biblios with items
535
    # Create 3 biblios with items
536
    my $biblio_1 = $builder->gimme_a_biblio({ itemtype => $itemtype->itemtype });
536
    my $biblio_1 = $builder->build_sample_biblio({ itemtype => $itemtype->itemtype });
537
    my ( undef, undef, $itemnumber_1 ) = AddItem(
537
    my ( undef, undef, $itemnumber_1 ) = AddItem(
538
        {   homebranch    => $library->branchcode,
538
        {   homebranch    => $library->branchcode,
539
            holdingbranch => $library->branchcode
539
            holdingbranch => $library->branchcode
540
        },
540
        },
541
        $biblio_1->biblionumber
541
        $biblio_1->biblionumber
542
    );
542
    );
543
    my $biblio_2 = $builder->gimme_a_biblio({ itemtype => $itemtype->itemtype });
543
    my $biblio_2 = $builder->build_sample_biblio({ itemtype => $itemtype->itemtype });
544
    my ( undef, undef, $itemnumber_2 ) = AddItem(
544
    my ( undef, undef, $itemnumber_2 ) = AddItem(
545
        {   homebranch    => $library->branchcode,
545
        {   homebranch    => $library->branchcode,
546
            holdingbranch => $library->branchcode
546
            holdingbranch => $library->branchcode
547
        },
547
        },
548
        $biblio_2->biblionumber
548
        $biblio_2->biblionumber
549
    );
549
    );
550
    my $biblio_3 = $builder->gimme_a_biblio({ itemtype => $itemtype->itemtype });
550
    my $biblio_3 = $builder->build_sample_biblio({ itemtype => $itemtype->itemtype });
551
    my ( undef, undef, $itemnumber_3 ) = AddItem(
551
    my ( undef, undef, $itemnumber_3 ) = AddItem(
552
        {   homebranch    => $library->branchcode,
552
        {   homebranch    => $library->branchcode,
553
            holdingbranch => $library->branchcode
553
            holdingbranch => $library->branchcode
(-)a/t/db_dependent/Holds/LocalHoldsPriority.t (-1 / +1 lines)
Lines 40-46 my $itemtype = $builder->build( Link Here
40
40
41
my $borrowers_count = 5;
41
my $borrowers_count = 5;
42
42
43
my $biblio = $builder->gimme_a_biblio();
43
my $biblio = $builder->build_sample_biblio();
44
my ( $item_bibnum, $item_bibitemnum, $itemnumber ) = AddItem(
44
my ( $item_bibnum, $item_bibitemnum, $itemnumber ) = AddItem(
45
    {   homebranch    => $library4->{branchcode},
45
    {   homebranch    => $library4->{branchcode},
46
        holdingbranch => $library3->{branchcode},
46
        holdingbranch => $library3->{branchcode},
(-)a/t/db_dependent/Holds/RevertWaitingStatus.t (-1 / +1 lines)
Lines 52-58 sub Mock_userenv { Link Here
52
52
53
my $borrowers_count = 3;
53
my $borrowers_count = 3;
54
54
55
my $biblio = $builder->gimme_a_biblio();
55
my $biblio = $builder->build_sample_biblio();
56
my $item_barcode = 'my_barcode';
56
my $item_barcode = 'my_barcode';
57
my ( $item_bibnum, $item_bibitemnum, $itemnumber ) = AddItem(
57
my ( $item_bibnum, $item_bibitemnum, $itemnumber ) = AddItem(
58
    {   homebranch    => $branchcode,
58
    {   homebranch    => $branchcode,
(-)a/t/db_dependent/Items.t (-9 / +9 lines)
Lines 56-62 subtest 'General Add, Get and Del tests' => sub { Link Here
56
56
57
    # Create a biblio instance for testing
57
    # Create a biblio instance for testing
58
    t::lib::Mocks::mock_preference('marcflavour', 'MARC21');
58
    t::lib::Mocks::mock_preference('marcflavour', 'MARC21');
59
    my $biblio = $builder->gimme_a_biblio();
59
    my $biblio = $builder->build_sample_biblio();
60
60
61
    # Add an item.
61
    # Add an item.
62
    my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $library->{branchcode}, holdingbranch => $library->{branchcode}, location => $location, itype => $itemtype->{itemtype} } , $biblio->biblionumber);
62
    my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $library->{branchcode}, holdingbranch => $library->{branchcode}, location => $location, itype => $itemtype->{itemtype} } , $biblio->biblionumber);
Lines 168-174 subtest 'GetHiddenItemnumbers tests' => sub { Link Here
168
168
169
    # Create a new biblio
169
    # Create a new biblio
170
    t::lib::Mocks::mock_preference('marcflavour', 'MARC21');
170
    t::lib::Mocks::mock_preference('marcflavour', 'MARC21');
171
    my $biblio = $builder->gimme_a_biblio();
171
    my $biblio = $builder->build_sample_biblio();
172
172
173
    # Add two items
173
    # Add two items
174
    my ( $item1_bibnum, $item1_bibitemnum, $item1_itemnumber ) = AddItem(
174
    my ( $item1_bibnum, $item1_bibitemnum, $item1_itemnumber ) = AddItem(
Lines 266-272 subtest 'GetItemsInfo tests' => sub { Link Here
266
    });
266
    });
267
267
268
    # Add a biblio
268
    # Add a biblio
269
    my $biblio = $builder->gimme_a_biblio();
269
    my $biblio = $builder->build_sample_biblio();
270
    # Add an item
270
    # Add an item
271
    my ( $item_bibnum, $item_bibitemnum, $itemnumber ) = AddItem(
271
    my ( $item_bibnum, $item_bibitemnum, $itemnumber ) = AddItem(
272
        {
272
        {
Lines 357-364 subtest 'SearchItems test' => sub { Link Here
357
    t::lib::Mocks::mock_preference('marcflavour', 'MARC21');
357
    t::lib::Mocks::mock_preference('marcflavour', 'MARC21');
358
    my $cpl_items_before = SearchItemsByField( 'homebranch', $library1->{branchcode});
358
    my $cpl_items_before = SearchItemsByField( 'homebranch', $library1->{branchcode});
359
359
360
    my $biblio = $builder->gimme_a_biblio({ title => 'Silence in the library' });
360
    my $biblio = $builder->build_sample_biblio({ title => 'Silence in the library' });
361
    $builder->gimme_a_biblio({ title => 'Silence in the shadow' });
361
    $builder->build_sample_biblio({ title => 'Silence in the shadow' });
362
362
363
    my (undef, $initial_items_count) = SearchItems(undef, {rows => 1});
363
    my (undef, $initial_items_count) = SearchItems(undef, {rows => 1});
364
364
Lines 535-541 subtest 'Koha::Item(s) tests' => sub { Link Here
535
535
536
    # Create a biblio and item for testing
536
    # Create a biblio and item for testing
537
    t::lib::Mocks::mock_preference('marcflavour', 'MARC21');
537
    t::lib::Mocks::mock_preference('marcflavour', 'MARC21');
538
    my $biblio = $builder->gimme_a_biblio();
538
    my $biblio = $builder->build_sample_biblio();
539
    my ( $item_bibnum, $item_bibitemnum, $itemnumber ) = AddItem(
539
    my ( $item_bibnum, $item_bibitemnum, $itemnumber ) = AddItem(
540
        {
540
        {
541
            homebranch    => $library1->{branchcode},
541
            homebranch    => $library1->{branchcode},
Lines 576-582 subtest 'C4::Biblio::EmbedItemsInMarcBiblio' => sub { Link Here
576
        source => 'Itemtype',
576
        source => 'Itemtype',
577
    });
577
    });
578
578
579
    my $biblio = $builder->gimme_a_biblio();
579
    my $biblio = $builder->build_sample_biblio();
580
    my $item_infos = [
580
    my $item_infos = [
581
        { homebranch => $library1->{branchcode}, holdingbranch => $library1->{branchcode} },
581
        { homebranch => $library1->{branchcode}, holdingbranch => $library1->{branchcode} },
582
        { homebranch => $library1->{branchcode}, holdingbranch => $library1->{branchcode} },
582
        { homebranch => $library1->{branchcode}, holdingbranch => $library1->{branchcode} },
Lines 703-709 subtest 'C4::Items::_build_default_values_for_mod_marc' => sub { Link Here
703
    my $itemtype = $builder->build({ source => 'Itemtype' })->{itemtype};
703
    my $itemtype = $builder->build({ source => 'Itemtype' })->{itemtype};
704
704
705
    # Create a record with a barcode
705
    # Create a record with a barcode
706
    my $biblio = $builder->gimme_a_biblio({ frameworkcode => $framework->{frameworkcode} });
706
    my $biblio = $builder->build_sample_biblio({ frameworkcode => $framework->{frameworkcode} });
707
    my $item_record = new MARC::Record;
707
    my $item_record = new MARC::Record;
708
    my $a_barcode = 'a barcode';
708
    my $a_barcode = 'a barcode';
709
    my $barcode_field = MARC::Field->new(
709
    my $barcode_field = MARC::Field->new(
Lines 849-855 subtest 'Test logging for ModItem' => sub { Link Here
849
849
850
    # Create a biblio instance for testing
850
    # Create a biblio instance for testing
851
    t::lib::Mocks::mock_preference('marcflavour', 'MARC21');
851
    t::lib::Mocks::mock_preference('marcflavour', 'MARC21');
852
    my $biblio = $builder->gimme_a_biblio();
852
    my $biblio = $builder->build_sample_biblio();
853
853
854
    # Add an item.
854
    # Add an item.
855
    my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $library->{branchcode}, holdingbranch => $library->{branchcode}, location => $location, itype => $itemtype->{itemtype} } , $biblio->biblionumber);
855
    my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $library->{branchcode}, holdingbranch => $library->{branchcode}, location => $location, itype => $itemtype->{itemtype} } , $biblio->biblionumber);
(-)a/t/db_dependent/Items/DelItem.t (-1 / +1 lines)
Lines 16-22 my $library = $builder->build({ Link Here
16
    source => 'Branch',
16
    source => 'Branch',
17
});
17
});
18
18
19
my $biblio = $builder->gimme_a_biblio();
19
my $biblio = $builder->build_sample_biblio();
20
20
21
my ( $item_bibnum, $item_bibitemnum, $itemnumber );
21
my ( $item_bibnum, $item_bibitemnum, $itemnumber );
22
( $item_bibnum, $item_bibitemnum, $itemnumber ) =
22
( $item_bibnum, $item_bibitemnum, $itemnumber ) =
(-)a/t/db_dependent/Items/GetItemsForInventory.t (-2 / +2 lines)
Lines 74-81 subtest 'Skip items with waiting holds' => sub { Link Here
74
    my $title_1 = 'Title 1, ';
74
    my $title_1 = 'Title 1, ';
75
    my $title_2 = 'Title 2, bizzarre one so doesn\'t already exist';
75
    my $title_2 = 'Title 2, bizzarre one so doesn\'t already exist';
76
76
77
    my $biblio_1 = $builder->gimme_a_biblio({ itemtype => $itemtype->itemtype, title => $title_1 });
77
    my $biblio_1 = $builder->build_sample_biblio({ itemtype => $itemtype->itemtype, title => $title_1 });
78
    my $biblio_2 = $builder->gimme_a_biblio({ itemtype => $itemtype->itemtype, title => $title_2 });
78
    my $biblio_2 = $builder->build_sample_biblio({ itemtype => $itemtype->itemtype, title => $title_2 });
79
79
80
    my ( $items_1, $first_items_count ) = GetItemsForInventory();
80
    my ( $items_1, $first_items_count ) = GetItemsForInventory();
81
    is( scalar @{$items_1}, $first_items_count, 'Results and count match' );
81
    is( scalar @{$items_1}, $first_items_count, 'Results and count match' );
(-)a/t/db_dependent/Koha/BiblioUtils/Iterator.t (-1 / +1 lines)
Lines 47-53 my $itemtype = $builder->build({ Link Here
47
47
48
# Create a biblio instance for testing
48
# Create a biblio instance for testing
49
t::lib::Mocks::mock_preference('marcflavour', 'MARC21');
49
t::lib::Mocks::mock_preference('marcflavour', 'MARC21');
50
my $biblio = $builder->gimme_a_biblio();
50
my $biblio = $builder->build_sample_biblio();
51
51
52
# Add an item.
52
# Add an item.
53
my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $library->{branchcode}, holdingbranch => $library->{branchcode}, location => $location, itype => $itemtype->{itemtype} } , $biblio->biblionumber);
53
my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $library->{branchcode}, holdingbranch => $library->{branchcode}, location => $location, itype => $itemtype->{itemtype} } , $biblio->biblionumber);
(-)a/t/db_dependent/Koha/Biblios.t (-1 / +1 lines)
Lines 143-149 subtest 'can_be_transferred' => sub { Link Here
143
    my $library1 = $builder->build_object( { class => 'Koha::Libraries' } );
143
    my $library1 = $builder->build_object( { class => 'Koha::Libraries' } );
144
    my $library2 = $builder->build_object( { class => 'Koha::Libraries' } );
144
    my $library2 = $builder->build_object( { class => 'Koha::Libraries' } );
145
    my $library3 = $builder->build_object( { class => 'Koha::Libraries' } );
145
    my $library3 = $builder->build_object( { class => 'Koha::Libraries' } );
146
    my $biblio = $builder->gimme_a_biblio({ itemtype => 'ONLY1' });
146
    my $biblio = $builder->build_sample_biblio({ itemtype => 'ONLY1' });
147
    my ($item_bibnum, $item_bibitemnum, $itemnumber)
147
    my ($item_bibnum, $item_bibitemnum, $itemnumber)
148
        = AddItem({ homebranch => $library1->branchcode, holdingbranch => $library1->branchcode }, $biblio->biblionumber);
148
        = AddItem({ homebranch => $library1->branchcode, holdingbranch => $library1->branchcode }, $biblio->biblionumber);
149
    my $item  = Koha::Items->find($itemnumber);
149
    my $item  = Koha::Items->find($itemnumber);
(-)a/t/db_dependent/Labels/t_Label.t (-1 / +1 lines)
Lines 58-64 my $itemtype = Link Here
58
58
59
C4::Context->set_userenv( undef, undef, undef, undef, undef, undef, $branch_1 );
59
C4::Context->set_userenv( undef, undef, undef, undef, undef, undef, $branch_1 );
60
60
61
my $bibnum = $builder->gimme_a_biblio({ frameworkcode => $frameworkcode })->biblionumber;
61
my $bibnum = $builder->build_sample_biblio({ frameworkcode => $frameworkcode })->biblionumber;
62
62
63
# Create a helper item instance for testing
63
# Create a helper item instance for testing
64
my ( $item_bibnum, $item_bibitemnum, $itemnumber ) = AddItem(
64
my ( $item_bibnum, $item_bibitemnum, $itemnumber ) = AddItem(
(-)a/t/db_dependent/OAI/Sets.t (-4 / +4 lines)
Lines 355-364 ok (!defined(AddOAISetsBiblios(my $arg=[])), 'AddOAISetsBiblios with a no HASH a Link Here
355
ok (defined(AddOAISetsBiblios($arg={})), 'AddOAISetsBiblios with a HASH argument is def');
355
ok (defined(AddOAISetsBiblios($arg={})), 'AddOAISetsBiblios with a HASH argument is def');
356
356
357
# Create a biblio instance for testing
357
# Create a biblio instance for testing
358
my $biblio_1 = $builder->gimme_a_biblio({ author => 'Moffat, Steven' });
358
my $biblio_1 = $builder->build_sample_biblio({ author => 'Moffat, Steven' });
359
my $biblionumber1 = $biblio_1->biblionumber;
359
my $biblionumber1 = $biblio_1->biblionumber;
360
isa_ok(\$biblionumber1, 'SCALAR', '$biblionumber1 is a SCALAR');
360
isa_ok(\$biblionumber1, 'SCALAR', '$biblionumber1 is a SCALAR');
361
my $biblio_2 = $builder->gimme_a_biblio({ author => 'Moffat, Steven' });
361
my $biblio_2 = $builder->build_sample_biblio({ author => 'Moffat, Steven' });
362
my $biblionumber2 = $biblio_2->biblionumber;
362
my $biblionumber2 = $biblio_2->biblionumber;
363
isa_ok(\$biblionumber2, 'SCALAR', '$biblionumber2 is a SCALAR');
363
isa_ok(\$biblionumber2, 'SCALAR', '$biblionumber2 is a SCALAR');
364
364
Lines 521-527 ModOAISetMappings($setVH_id, $mappingsVH); Link Here
521
521
522
522
523
#Create a biblio notice corresponding at one of mappings
523
#Create a biblio notice corresponding at one of mappings
524
my $biblio_VH = $builder->gimme_a_biblio({ author => 'Victor Hugo' });
524
my $biblio_VH = $builder->build_sample_biblio({ author => 'Victor Hugo' });
525
my $biblionumberVH = $biblio_VH->biblionumber;
525
my $biblionumberVH = $biblio_VH->biblionumber;
526
526
527
#Update
527
#Update
Lines 577-583 ModOAISetMappings($setNotVH_id, $mappingsNotVH); Link Here
577
577
578
578
579
#Create a biblio notice corresponding at one of mappings
579
#Create a biblio notice corresponding at one of mappings
580
my $biblio_NotVH = $builder->gimme_a_biblio({ author => 'Sponge, Bob' });
580
my $biblio_NotVH = $builder->build_sample_biblio({ author => 'Sponge, Bob' });
581
my $biblionumberNotVH = $biblio_NotVH->biblionumber;
581
my $biblionumberNotVH = $biblio_NotVH->biblionumber;
582
582
583
#Update
583
#Update
(-)a/t/db_dependent/Reserves.t (-2 / +2 lines)
Lines 81-87 C4::Context->set_userenv( Link Here
81
    undef, undef, undef, undef, undef, undef, $branch_1
81
    undef, undef, undef, undef, undef, undef, $branch_1
82
);
82
);
83
83
84
my $bibnum = $builder->gimme_a_biblio({frameworkcode => $frameworkcode})->biblionumber;
84
my $bibnum = $builder->build_sample_biblio({frameworkcode => $frameworkcode})->biblionumber;
85
85
86
# Create a helper item instance for testing
86
# Create a helper item instance for testing
87
my ( $item_bibnum, $item_bibitemnum, $itemnumber ) = AddItem(
87
my ( $item_bibnum, $item_bibitemnum, $itemnumber ) = AddItem(
Lines 214-220 $dbh->do( Link Here
214
    $branch_2, 10, 2, 'homebranch',
214
    $branch_2, 10, 2, 'homebranch',
215
);
215
);
216
216
217
my $bibnum2 = $builder->gimme_a_biblio({frameworkcode => $frameworkcode})->biblionumber;
217
my $bibnum2 = $builder->build_sample_biblio({frameworkcode => $frameworkcode})->biblionumber;
218
218
219
my ($itemnum_cpl, $itemnum_fpl);
219
my ($itemnum_cpl, $itemnum_fpl);
220
( undef, undef, $itemnum_cpl ) = AddItem(
220
( undef, undef, $itemnum_cpl ) = AddItem(
(-)a/t/db_dependent/Serials.t (-1 / +1 lines)
Lines 145-151 subtest 'Values should not be erased on editing' => sub { Link Here
145
145
146
    plan tests => 1;
146
    plan tests => 1;
147
147
148
    my $biblio = $builder->gimme_a_biblio();
148
    my $biblio = $builder->build_sample_biblio();
149
    my $biblionumber = $biblio->biblionumber;
149
    my $biblionumber = $biblio->biblionumber;
150
    my ( $icn_tag, $icn_sf ) = GetMarcFromKohaField( 'items.itemcallnumber', '' );
150
    my ( $icn_tag, $icn_sf ) = GetMarcFromKohaField( 'items.itemcallnumber', '' );
151
    my ( $it_tag, $it_sf )   = GetMarcFromKohaField( 'items.itype', '' );
151
    my ( $it_tag, $it_sf )   = GetMarcFromKohaField( 'items.itype', '' );
(-)a/t/lib/TestBuilder.pm (-2 / +1 lines)
Lines 127-133 sub build { Link Here
127
    });
127
    });
128
}
128
}
129
129
130
sub gimme_a_biblio {
130
sub build_sample_biblio {
131
    my ( $self, $args ) = @_;
131
    my ( $self, $args ) = @_;
132
132
133
    my $title  = $args->{title}  || 'Some boring read';
133
    my $title  = $args->{title}  || 'Some boring read';
134
- 

Return to bug 21798