Lines 1-13
Link Here
|
1 |
#!/usr/bin/perl |
1 |
#!/usr/bin/perl |
2 |
use Modern::Perl; |
2 |
use Modern::Perl; |
3 |
|
3 |
|
4 |
use Test::More tests => 50; |
4 |
use Test::More tests => 52; |
5 |
|
5 |
|
6 |
use MARC::Record; |
6 |
use MARC::Record; |
7 |
|
7 |
|
8 |
use C4::Biblio qw( AddBiblio ); |
8 |
use C4::Biblio qw( AddBiblio ); |
9 |
use Koha::Database; |
9 |
use Koha::Database; |
10 |
use Koha::Patrons; |
10 |
use Koha::Patrons; |
|
|
11 |
use Koha::DateUtils qw( dt_from_string ); |
11 |
use t::lib::Mocks; |
12 |
use t::lib::Mocks; |
12 |
use t::lib::TestBuilder; |
13 |
use t::lib::TestBuilder; |
13 |
use_ok('C4::Serials'); |
14 |
use_ok('C4::Serials'); |
Lines 293-295
sub set_flags {
Link Here
|
293 |
); |
294 |
); |
294 |
} |
295 |
} |
295 |
} |
296 |
} |
296 |
- |
297 |
|
|
|
298 |
# test publication date as numbering pattern |
299 |
|
300 |
my $subscriptionid_pubdatenumpattern = NewSubscription( |
301 |
undef, $my_branch, undef, undef, $budget_id, $biblionumber, |
302 |
'2013-01-01', undef, undef, undef, undef, |
303 |
undef, undef, undef, undef, undef, |
304 |
undef, 1, "notes", undef, '2013-01-01', undef, |
305 |
undef, undef, undef, 0, "intnotes", |
306 |
0, undef, undef, 0, |
307 |
undef, '2013-12-31', 0, undef, undef, undef, |
308 |
'dmy' |
309 |
); |
310 |
|
311 |
my $serial_pubdatenumpattern = Koha::Serials->find({ subscriptionid => $subscriptionid_pubdatenumpattern }); |
312 |
|
313 |
is( $serial_pubdatenumpattern->serialseq, '01 January 2013', 'serialseq should be set to first acuisition date in the date format specified' ); |
314 |
|
315 |
ModSubscription( |
316 |
undef, $my_branch, undef, undef, $budget_id, '2013-01-01', |
317 |
undef, '2013-01-01', undef, undef, undef, |
318 |
undef, undef, undef, undef, undef, |
319 |
undef, undef, undef, undef, 1, |
320 |
$biblionumber, undef, "notes", undef, 0, |
321 |
"intnotes", 0, undef, undef, |
322 |
0, undef, '2013-12-31', $subscriptionid_pubdatenumpattern, 0, |
323 |
undef, undef, undef, 'ydm' |
324 |
); |
325 |
|
326 |
my $serialid_pubdatenumpattern = NewIssue( "pubdate", $subscriptionid_pubdatenumpattern, $biblionumber, 1 ); |
327 |
|
328 |
my $serial_pubdatenumpattern_2 = Koha::Serials->find( $serialid_pubdatenumpattern ); |
329 |
|
330 |
is( $serial_pubdatenumpattern_2->serialseq, dt_from_string( $serial_pubdatenumpattern_2->publisheddate )->strftime('%Y %d %B'), 'receive new issue with new pub date num pattern format' ); |