use C4::Auth;
use C4::Biblio;
-use C4::Bookfund;
use C4::Bookseller;
use C4::Context;
use C4::Items;
sub startup_15_truncate_tables : Test( startup => 1 ) {
my $self = shift;
-
- my @truncate_tables = qw( accountlines
- accountoffsets
- alert
- aqbasket
- aqbooksellers
- aqorderbreakdown
- aqorderdelivery
- aqorders
- auth_header
- branchcategories
- branchrelations
- branchtransfers
- browser
- cities
- deletedbiblio
- deletedbiblioitems
- deletedborrowers
- deleteditems
- ethnicity
- issues
- issuingrules
- labels_batches
- labels_layouts
- labels_templates
- matchchecks
- notifys
- nozebra
- old_issues
- old_reserves
- overduerules
- patroncards
- patronimage
- printers
- printers_profile
- reports_dictionary
- reserveconstraints
- reserves
- reviews
- roadtype
- saved_reports
- saved_sql
- serial
- serialitems
- services_throttle
- special_holidays
- statistics
- subscription
- subscriptionhistory
- subscriptionroutinglist
- suggestions
- tags
- virtualshelfcontents
+
+# my @truncate_tables = qw( accountlines
+# accountoffsets
+# action_logs
+# alert
+# aqbasket
+# aqbookfund
+# aqbooksellers
+# aqbudget
+# aqorderdelivery
+# aqorders
+# auth_header
+# auth_subfield_structure
+# auth_tag_structure
+# auth_types
+# authorised_values
+# biblio
+# biblio_framework
+# biblioitems
+# borrowers
+# branchcategories
+# branches
+# branchrelations
+# branchtransfers
+# browser
+# categories
+# cities
+# class_sort_rules
+# class_sources
+# currency
+# deletedbiblio
+# deletedbiblioitems
+# deletedborrowers
+# deleteditems
+# ethnicity
+# import_batches
+# import_biblios
+# import_items
+# import_record_matches
+# import_records
+# issues
+# issuingrules
+# items
+# itemtypes
+# labels
+# labels_conf
+# labels_profile
+# labels_templates
+# language_descriptions
+# language_rfc4646_to_iso639
+# language_script_bidi
+# language_script_mapping
+# language_subtag_registry
+# letter
+# marc_matchers
+# marc_subfield_structure
+# marc_tag_structure
+# matchchecks
+# matcher_matchpoints
+# matchpoint_component_norms
+# matchpoint_components
+# matchpoints
+# notifys
+# nozebra
+# old_issues
+# old_reserves
+# opac_news
+# overduerules
+# patroncards
+# patronimage
+# printers
+# printers_profile
+# repeatable_holidays
+# reports_dictionary
+# reserveconstraints
+# reserves
+# reviews
+# roadtype
+# saved_reports
+# saved_sql
+# serial
+# serialitems
+# services_throttle
+# sessions
+# special_holidays
+# statistics
+# stopwords
+# subscription
+# subscriptionhistory
+# subscriptionroutinglist
+# suggestions
+# systempreferences
+# tags
+# userflags
+# virtualshelfcontents
+# virtualshelves
+# z3950servers
+# zebraqueue
+# );
+
+ my @truncate_tables = qw( accountlines
+ accountoffsets
+ alert
+ aqbasket
+ aqbooksellers
+ aqorderdelivery
+ aqorders
+ auth_header
+ branchcategories
+ branchrelations
+ branchtransfers
+ browser
+ cities
+ deletedbiblio
+ deletedbiblioitems
+ deletedborrowers
+ deleteditems
+ ethnicity
+ issues
+ issuingrules
+ labels
+ labels_profile
+ matchchecks
+ notifys
+ nozebra
+ old_issues
+ old_reserves
+ overduerules
+ patroncards
+ patronimage
+ printers
+ printers_profile
+ reports_dictionary
+ reserveconstraints
+ reserves
+ reviews
+ roadtype
+ saved_reports
+ saved_sql
+ serial
+ serialitems
+ services_throttle
+ special_holidays
+ statistics
+ subscription
+ subscriptionhistory
+ subscriptionroutinglist
+ suggestions
+ tags
+ virtualshelfcontents
);
-
+
my $failed_to_truncate = 0;
foreach my $table ( @truncate_tables ) {
my $dbh = C4::Context->dbh();
my $id = AddBookseller( $booksellerinfo );
ok( $id, "created bookseller: $id" );
$self->{'booksellerid'} = $id;
-
+
return;
}
# diag( Data::Dumper->Dump( [ $bookfund ], qw( bookfund ) ) );
is( $bookfund->{'bookfundid'}, $bookfundid, "found bookfund: '$bookfundid'" );
is( $bookfund->{'bookfundname'}, 'General Stacks', "found bookfund: '$bookfundid'" );
-
+
$self->{'bookfundid'} = $bookfundid;
return;
}
my $borrowernumber = AddMember( %$memberinfo );
ok( $borrowernumber, "created member: $borrowernumber" );
$self->{'memberid'} = $borrowernumber;
-
+
return;
}
$self->{'sessionid'} = '12345678'; # does this value matter?
my $borrower_details = C4::Members::GetMemberDetails( $self->{'memberid'} );
ok( $borrower_details->{'cardnumber'}, 'cardnumber' );
-
+
# make a cookie and force it into $cgi.
# This would be a lot easier with Test::MockObject::Extends.
my $cgi = CGI->new( { userid => $borrower_details->{'cardnumber'},
# my $session = C4::Auth::get_session( $sessionID );
# diag( Data::Dumper->Dump( [ $session ], [ qw( session ) ] ) );
-
+
}
$randomstring .= $alphabet[ rand( scalar( @alphabet ) ) ];
}
return $randomstring;
-
+
}
=head3 random_phone
my $self = shift;
return '212-555-5555';
-
+
}
=head3 random_email
my $self = shift;
return $self->random_string() . '@example.com';
-
+
}
=head3 random_ip
my $self = shift;
return '127.0.0.2';
-
+
}
=head3 random_date
);
my $appendedfieldscount = $marcrecord->append_fields( @marc_fields );
-
+
diag $MARC::Record::ERROR if ( $MARC::Record::ERROR );
is( $appendedfieldscount, scalar @marc_fields, 'added correct number of MARC fields' );
-
+
my $frameworkcode = ''; # XXX I'd like to put something reasonable here.
my ( $biblionumber, $biblioitemnumber ) = AddBiblio( $marcrecord, $frameworkcode );
ok( $biblionumber, "the biblionumber is $biblionumber" );
}
push @{$self->{'biblios'}}, $biblionumber;
}
-
- $self->reindex_marc();
+
+ $self->reindex_marc();
my $query = 'Finn Test';
my ( $error, $results ) = SimpleSearch( $query );
if ( $param{'count'} <= scalar( @$results ) ) {
} else {
fail( "we never found all $param{'count'} titles" );
}
-
+
}
=head3 reindex_marc
system "zebraidx -c $zebra_config -d $zebra_db -g iso2709 update $directory/${record_type} > /dev/null 2>\&1";
system "zebraidx -c $zebra_config -d $zebra_db -g iso2709 commit > /dev/null 2>\&1";
}
-
+
}
if ( $return != 0 ) {
diag( "command '$command' died with value: " . $? >> 8 );
}
-
+
$command = "zebraidx -c $zebra_config -d $zebra_db_name create $zebra_db_name";
diag $command;
$return = system( $command . ' > /dev/null 2>&1' );
}
}
}
-
+
diag 'starting zebrasrv...';
my $pidfile = File::Spec->catdir( C4::Context->config("logdir"), 'zebra.pid' );
diag $command;
my $started = system( $command );
diag "started: $started";
-
+
}
=head3 stop_zebraqueue_daemon