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

(-)a/t/db_dependent/Koha/Items.t (-2 / +18 lines)
Lines 19-30 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 8;
22
use Test::More tests => 9;
23
23
24
use C4::Circulation;
24
use C4::Circulation;
25
use Koha::Item;
25
use Koha::Item;
26
use Koha::Items;
26
use Koha::Items;
27
use Koha::Database;
27
use Koha::Database;
28
use Koha::RotatingCollections;
28
29
29
use t::lib::TestBuilder;
30
use t::lib::TestBuilder;
30
31
Lines 118-123 subtest 'checkout' => sub { Link Here
118
    is( $checkout, undef, 'Koha::Item->checkout should return undef if there is no *current* checkout on this item' );
119
    is( $checkout, undef, 'Koha::Item->checkout should return undef if there is no *current* checkout on this item' );
119
};
120
};
120
121
122
subtest 'rotating_collection' => sub {
123
    plan tests => 2;
124
125
    my $collection = Koha::RotatingCollection->new( {
126
        colTitle => 'Collection title',
127
        colDesc  => 'Collection description',
128
    } )->store;
129
130
    my $item = Koha::Items->find( $new_item_1->itemnumber );
131
    $collection->add_item( $item );
132
    my $retrieved_collection = $item->rotating_collection;
133
134
    is( ref( $retrieved_collection ), 'Koha::RotatingCollection', 'Koha::Item->rotating_collection should return a Koha::RotatingCollection' );
135
    is( $retrieved_collection->colId, $collection->colId, 'Koha::Item->rotating_collection should return right collection' );
136
};
137
121
$retrieved_item_1->delete;
138
$retrieved_item_1->delete;
122
is( Koha::Items->search->count, $nb_of_items + 1, 'Delete should have deleted the item' );
139
is( Koha::Items->search->count, $nb_of_items + 1, 'Delete should have deleted the item' );
123
140
124
- 

Return to bug 18606