Bug 8435: (follow-up) the unit tests should create the biblio
authorJonathan Druart <jonathan.druart@biblibre.com>
Wed, 21 Aug 2013 12:23:24 +0000 (14:23 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 31 Oct 2013 15:29:32 +0000 (15:29 +0000)
Previous version does not create the biblio.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
t/db_dependent/Serials_2.t

index 83bcbf8..72d71d9 100644 (file)
@@ -3,6 +3,8 @@ use Modern::Perl;
 
 use Test::More tests => 4;
 
+use MARC::Record;
+use C4::Biblio qw( AddBiblio );
 use_ok('C4::Serials');
 use_ok('C4::Budgets');
 
@@ -13,11 +15,16 @@ $dbh->{RaiseError} = 1;
 my $supplierlist=eval{GetSuppliersWithLateIssues()};
 ok(length($@)==0,"No SQL problem in GetSuppliersWithLateIssues");
 
-my $biblionumber = 1;
+my $record = MARC::Record->new();
+$record->append_fields(
+    MARC::Field->new( '952', '0', '0', a => 'CPL', b => 'CPL' )
+);
+my ( $biblionumber, $biblioitemnumber ) = C4::Biblio::AddBiblio($record, '');
+
 my $budgetid;
 my $bpid = AddBudgetPeriod({
     budget_period_startdate => '01-01-2015',
-    budget_period_enddate   => '31-12-2015',
+    budget_period_enddate   => '12-31-2015',
     budget_description      => "budget desc"
 });
 
@@ -37,7 +44,7 @@ my $subscriptionid = NewSubscription(
     undef,      undef,  undef, undef, undef,      undef,         undef,  undef,
     undef,      undef,  undef, undef, undef,      undef,         undef,  1,
     "notes",    undef,  undef, undef, undef,      undef,         undef,  0,
-    "intnotes", 0,      undef, undef, 0,          undef,         '31-12-2013',
+    "intnotes", 0,      undef, undef, 0,          undef,         '12-31-2013',
 );
 die unless $subscriptionid;