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

(-)a/Koha/Item.pm (+14 lines)
Lines 92-97 sub biblio { Link Here
92
    return Koha::Biblio->_new_from_dbic( $biblio_rs );
92
    return Koha::Biblio->_new_from_dbic( $biblio_rs );
93
}
93
}
94
94
95
=head3 biblioitem
96
97
my $biblioitem = $item->biblioitem;
98
99
Return the biblioitem record of this item
100
101
=cut
102
103
sub biblioitem {
104
    my ( $self ) = @_;
105
    my $biblioitem_rs = $self->_result->biblioitem;
106
    return Koha::Biblioitem->_new_from_dbic( $biblioitem_rs );
107
}
108
95
=head3 get_transfer
109
=head3 get_transfer
96
110
97
my $transfer = $item->get_transfer;
111
my $transfer = $item->get_transfer;
(-)a/t/db_dependent/Koha/Items.t (-3 / +10 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 6;
22
use Test::More tests => 7;
23
23
24
use C4::Circulation;
24
use C4::Circulation;
25
use Koha::Item;
25
use Koha::Item;
Lines 78-87 subtest 'biblio' => sub { Link Here
78
    plan tests => 2;
78
    plan tests => 2;
79
79
80
    my $biblio = $retrieved_item_1->biblio;
80
    my $biblio = $retrieved_item_1->biblio;
81
    is( ref( $biblio ), 'Koha::Biblio', 'Koha::Item->bilio should return a Koha::Biblio' );
81
    is( ref( $biblio ), 'Koha::Biblio', 'Koha::Item->biblio should return a Koha::Biblio' );
82
    is( $biblio->biblionumber, $retrieved_item_1->biblionumber, 'Koha::Item->biblio should return the correct biblio' );
82
    is( $biblio->biblionumber, $retrieved_item_1->biblionumber, 'Koha::Item->biblio should return the correct biblio' );
83
};
83
};
84
84
85
subtest 'biblioitem' => sub {
86
    plan tests => 2;
87
88
    my $biblioitem = $retrieved_item_1->biblioitem;
89
    is( ref( $biblioitem ), 'Koha::Biblioitem', 'Koha::Item->biblioitem should return a Koha::Biblioitem' );
90
    is( $biblioitem->biblionumber, $retrieved_item_1->biblionumber, 'Koha::Item->biblioitem should return the correct biblioitem' );
91
};
92
85
$retrieved_item_1->delete;
93
$retrieved_item_1->delete;
86
is( Koha::Items->search->count, $nb_of_items + 1, 'Delete should have deleted the item' );
94
is( Koha::Items->search->count, $nb_of_items + 1, 'Delete should have deleted the item' );
87
95
88
- 

Return to bug 18459