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