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

(-)a/Koha/Item.pm (+14 lines)
Lines 77-82 sub holding_branch { Link Here
77
    return $self->{_holding_branch};
77
    return $self->{_holding_branch};
78
}
78
}
79
79
80
=head3 biblio
81
82
my $biblio = $item->biblio;
83
84
Return the bibliographic record of this item
85
86
=cut
87
88
sub biblio {
89
    my ( $self ) = @_;
90
    my $biblio_rs = $self->_result->biblio;
91
    return Koha::Biblio->_new_from_dbic( $self->_result->biblio );
92
}
93
80
=head3 get_transfer
94
=head3 get_transfer
81
95
82
my $transfer = $item->get_transfer;
96
my $transfer = $item->get_transfer;
(-)a/t/db_dependent/Koha/Items.t (-2 / +9 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 5;
22
use Test::More tests => 6;
23
23
24
use C4::Circulation;
24
use C4::Circulation;
25
use Koha::Item;
25
use Koha::Item;
Lines 74-79 subtest 'get_transfer' => sub { Link Here
74
    is( $transfer->itemnumber, $new_item_1->itemnumber, 'Koha::Item->get_transfer should return a valid Koha::Item::Transfers object' );
74
    is( $transfer->itemnumber, $new_item_1->itemnumber, 'Koha::Item->get_transfer should return a valid Koha::Item::Transfers object' );
75
};
75
};
76
76
77
subtest 'biblio' => sub {
78
    plan tests => 2;
79
80
    my $biblio = $retrieved_item_1->biblio;
81
    is( ref( $biblio ), 'Koha::Biblio', 'Koha::Item->bilio should return a Koha::Biblio' );
82
    is( $biblio->biblionumber, $retrieved_item_1->biblionumber, 'Koha::Item->biblio should return the correct biblio' );
83
};
84
77
$retrieved_item_1->delete;
85
$retrieved_item_1->delete;
78
is( Koha::Items->search->count, $nb_of_items + 1, 'Delete should have deleted the item' );
86
is( Koha::Items->search->count, $nb_of_items + 1, 'Delete should have deleted the item' );
79
87
80
- 

Return to bug 17974