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

(-)a/Koha/Biblio.pm (+13 lines)
Lines 45-50 Koha::Biblio - Koha Biblio Object class Link Here
45
45
46
=cut
46
=cut
47
47
48
=head3 new
49
50
Overloaded I<new> method to set default values
51
52
=cut
53
54
sub new {
55
    my ( $class, $params ) = @_;
56
57
    $params->{datecreated} ||= dt_from_string;
58
    return $class->SUPER::new($params);
59
}
60
48
=head3 subtitles
61
=head3 subtitles
49
62
50
my @subtitles = $biblio->subtitles();
63
my @subtitles = $biblio->subtitles();
(-)a/t/db_dependent/Koha/Biblios.t (-2 / +6 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 2;
22
use Test::More tests => 3;
23
23
24
use C4::Reserves;
24
use C4::Reserves;
25
25
Lines 45-50 my $biblioitem = $schema->resultset('Biblioitem')->new( Link Here
45
    }
45
    }
46
)->insert();
46
)->insert();
47
47
48
subtest 'new' => sub {
49
    plan tests => 1;
50
    is( $biblio->datecreated, dt_from_string, "datecreated must be set to today if not passed to the constructor" );
51
};
52
48
subtest 'holds + current_holds' => sub {
53
subtest 'holds + current_holds' => sub {
49
    plan tests => 5;
54
    plan tests => 5;
50
    C4::Reserves::AddReserve( $patron->branchcode, $patron->borrowernumber, $biblio->biblionumber );
55
    C4::Reserves::AddReserve( $patron->branchcode, $patron->borrowernumber, $biblio->biblionumber );
51
- 

Return to bug 20176