Lines 108-122
subtest 'General Add, Get and Del tests' => sub {
Link Here
|
108 |
is( $getitem->location, $location, "The location should not have been modified" ); |
108 |
is( $getitem->location, $location, "The location should not have been modified" ); |
109 |
is( $getitem->permanent_location, 'my permanent location', "The permanent_location should not have modified" ); |
109 |
is( $getitem->permanent_location, 'my permanent location', "The permanent_location should not have modified" ); |
110 |
|
110 |
|
111 |
$getitem->location($location)->store; |
111 |
my $new_location = "New location"; |
|
|
112 |
$getitem->location($new_location)->store; |
112 |
$getitem = Koha::Items->find($itemnumber); |
113 |
$getitem = Koha::Items->find($itemnumber); |
113 |
is( $getitem->location, $location, "The location should have been set to correct location" ); |
114 |
is( $getitem->location, $new_location, "The location should have been set to correct location" ); |
114 |
is( $getitem->permanent_location, $location, "The permanent_location should have been set to location" ); |
115 |
is( $getitem->permanent_location, $new_location, "The permanent_location should have been set to location" ); |
115 |
|
116 |
|
116 |
$getitem->location('CART')->store; |
117 |
$getitem->location('CART')->store; |
117 |
$getitem = Koha::Items->find($itemnumber); |
118 |
$getitem = Koha::Items->find($itemnumber); |
118 |
is( $getitem->location, 'CART', "The location should have been set to CART" ); |
119 |
is( $getitem->location, 'CART', "The location should have been set to CART" ); |
119 |
is( $getitem->permanent_location, $location, "The permanent_location should not have been set to CART" ); |
120 |
is( $getitem->permanent_location, $new_location, "The permanent_location should not have been set to CART" ); |
120 |
|
121 |
|
121 |
t::lib::Mocks::mock_preference('item-level_itypes', '1'); |
122 |
t::lib::Mocks::mock_preference('item-level_itypes', '1'); |
122 |
$getitem = Koha::Items->find($itemnumber); |
123 |
$getitem = Koha::Items->find($itemnumber); |
Lines 840-846
subtest 'Test logging for ModItem' => sub {
Link Here
|
840 |
|
841 |
|
841 |
# True means logging |
842 |
# True means logging |
842 |
$schema->resultset('ActionLog')->search()->delete(); |
843 |
$schema->resultset('ActionLog')->search()->delete(); |
843 |
$item->location($location)->store({ log_action => 1 }); |
844 |
$item->location('new location')->store({ log_action => 1 }); |
844 |
is( $schema->resultset('ActionLog')->count(), 1, 'True value does trigger logging' ); |
845 |
is( $schema->resultset('ActionLog')->count(), 1, 'True value does trigger logging' ); |
845 |
|
846 |
|
846 |
# Undefined defaults to true |
847 |
# Undefined defaults to true |
847 |
- |
|
|