|
Lines 19-25
Link Here
|
| 19 |
|
19 |
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
|
21 |
|
| 22 |
use Test::More tests => 9; |
22 |
use Test::More tests => 10; |
| 23 |
use Test::Exception; |
23 |
use Test::Exception; |
| 24 |
|
24 |
|
| 25 |
use C4::Circulation; |
25 |
use C4::Circulation; |
|
Lines 27-32
use Koha::Item;
Link Here
|
| 27 |
use Koha::Item::Transfer::Limits; |
27 |
use Koha::Item::Transfer::Limits; |
| 28 |
use Koha::Items; |
28 |
use Koha::Items; |
| 29 |
use Koha::Database; |
29 |
use Koha::Database; |
|
|
30 |
use Koha::RotatingCollections; |
| 30 |
|
31 |
|
| 31 |
use t::lib::TestBuilder; |
32 |
use t::lib::TestBuilder; |
| 32 |
use t::lib::Mocks; |
33 |
use t::lib::Mocks; |
|
Lines 161-166
subtest 'can_be_transferred' => sub {
Link Here
|
| 161 |
'We get the same result also if we pass the from-library parameter.'); |
162 |
'We get the same result also if we pass the from-library parameter.'); |
| 162 |
}; |
163 |
}; |
| 163 |
|
164 |
|
|
|
165 |
subtest 'rotating_collection' => sub { |
| 166 |
plan tests => 2; |
| 167 |
|
| 168 |
my $collection = Koha::RotatingCollection->new( { |
| 169 |
colTitle => 'Collection title', |
| 170 |
colDesc => 'Collection description', |
| 171 |
} )->store; |
| 172 |
|
| 173 |
my $item = Koha::Items->find( $new_item_1->itemnumber ); |
| 174 |
$collection->add_item( $item ); |
| 175 |
my $retrieved_collection = $item->rotating_collection; |
| 176 |
|
| 177 |
is( ref( $retrieved_collection ), 'Koha::RotatingCollection', 'Koha::Item->rotating_collection should return a Koha::RotatingCollection' ); |
| 178 |
is( $retrieved_collection->colId, $collection->colId, 'Koha::Item->rotating_collection should return right collection' ); |
| 179 |
}; |
| 180 |
|
| 164 |
$retrieved_item_1->delete; |
181 |
$retrieved_item_1->delete; |
| 165 |
is( Koha::Items->search->count, $nb_of_items + 1, 'Delete should have deleted the item' ); |
182 |
is( Koha::Items->search->count, $nb_of_items + 1, 'Delete should have deleted the item' ); |
| 166 |
|
183 |
|
| 167 |
- |
|
|