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

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

Return to bug 20176