Lines 37-42
use List::MoreUtils qw(all);
Link Here
|
37 |
|
37 |
|
38 |
use t::lib::TestBuilder; |
38 |
use t::lib::TestBuilder; |
39 |
use t::lib::Mocks; |
39 |
use t::lib::Mocks; |
|
|
40 |
use t::lib::Dates; |
40 |
|
41 |
|
41 |
my $schema = Koha::Database->new->schema; |
42 |
my $schema = Koha::Database->new->schema; |
42 |
my $builder = t::lib::TestBuilder->new; |
43 |
my $builder = t::lib::TestBuilder->new; |
Lines 765-771
subtest 'request_transfer' => sub {
Link Here
|
765 |
}; |
766 |
}; |
766 |
|
767 |
|
767 |
subtest 'deletion' => sub { |
768 |
subtest 'deletion' => sub { |
768 |
plan tests => 13; |
769 |
plan tests => 15; |
769 |
|
770 |
|
770 |
$schema->storage->txn_begin; |
771 |
$schema->storage->txn_begin; |
771 |
|
772 |
|
Lines 776-784
subtest 'deletion' => sub {
Link Here
|
776 |
biblionumber => $biblio->biblionumber, |
777 |
biblionumber => $biblio->biblionumber, |
777 |
} |
778 |
} |
778 |
); |
779 |
); |
|
|
780 |
is( $item->deleted_on, undef, 'deleted_on not set for new item' ); |
779 |
|
781 |
|
780 |
is( ref( $item->move_to_deleted ), 'Koha::Schema::Result::Deleteditem', 'Koha::Item->move_to_deleted should return the Deleted item' ) |
782 |
my $deleted_item = $item->move_to_deleted; |
|
|
783 |
is( ref( $deleted_item ), 'Koha::Schema::Result::Deleteditem', 'Koha::Item->move_to_deleted should return the Deleted item' ) |
781 |
; # FIXME This should be Koha::Deleted::Item |
784 |
; # FIXME This should be Koha::Deleted::Item |
|
|
785 |
is( t::lib::Dates::compare( $deleted_item->deleted_on, dt_from_string() ), 0 ); |
786 |
|
782 |
is( Koha::Old::Items->search({itemnumber => $item->itemnumber})->count, 1, '->move_to_deleted must have moved the item to deleteditem' ); |
787 |
is( Koha::Old::Items->search({itemnumber => $item->itemnumber})->count, 1, '->move_to_deleted must have moved the item to deleteditem' ); |
783 |
$item = $builder->build_sample_item( |
788 |
$item = $builder->build_sample_item( |
784 |
{ |
789 |
{ |
785 |
- |
|
|