If a test method is decorated with an Expensive attribute, it is skipped unless the RUN_EXPENSIVE_TESTS environment variable is defined.
To declare an entire test class and its subclasses expensive, define a SKIP_CLASS with the Expensive attribute:
sub SKIP_CLASS : Expensive { }
these are run once, at the beginning of the whole test suite
we need a bookseller for many of the tests, so let's insert one. Feel free to use this one, or insert your own.
we need a bookfund for many of the tests. This currently uses one that is in the skeleton database. free to use this one, or insert your own.
sub startup_22_add_bookfund : Test(startup => 2) { my $self = shift;
my $bookfundid = 'GEN'; my $bookfund = GetBookFund( $bookfundid, undef ); # 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; }
Add a patron/member for the tests to use
setup methods are run before every test method
teardown methods are many time, once at the end of each test method.
shutdown methods are run once, at the end of the test suite
These are not test methods, but they're handy
Nice for generating names and such. It's not actually random, more like arbitrary.
generates a random phone number. Currently, it's not actually random. It's an unusable US phone number
generates a random email address. They're all in the unusable 'example.com' domain that is designed for this purpose.
returns an IP address suitable for testing purposes.
returns a somewhat random date in the iso (yyyy-mm-dd) format.
returns tomorrow's date as YYYY-MM-DD.
returns yesterday's date as YYYY-MM-DD.
returns an arbitrary date based on today in YYYY-MM-DD format.
$self->add_biblios( count => 10, add_items => 1, ); named parameters: count: number of biblios to add add_items: should you add items for each one? returns: I don't know yet. side effects: adds the biblionumbers to the $self->{'biblios'} listref Notes: Should I allow you to pass in biblio information, like title? Since this method is in the KohaTest class, all tests in it will be ignored, unless you call this from your own namespace. This runs 10 tests, plus 4 for each "count", plus 3 more for each item added.
Do a fast reindexing of all of the bib and authority records and mark all zebraqueue entries done.
Useful for test routines that need to do a lot of indexing without having to wait for zebraqueue.
In NoZebra model, this only marks zebraqueue done - the records should already be indexed.
removes all tables from test database so that install starts with a clean slate
sets up the test database.
This method deletes and reinitializes the zebra database directory, and then spans off a zebra server.
using the PID file for the zebra server, send it a TERM signal with "kill". We can't tell if the process actually dies or not.
kick off a zebraqueue_daemon.pl process.