* removed lib/KohaTest/Labels.pm, which is now completely outdated
* updated list of database tables to truncate in lib/KohaTest.pm
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This patch adds two warning messages to places in the test suite that
may fail. I don't think it changes any functionality, but it sure makes
it easier to figure out what has gone wrong.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
The tests I wrote for C4::Items::GetItemsForInventory confused the differences
between biblionumber and itemnumber. That wasn't uncovered on my limited test
database, but I uncovered it later.
This fixes that problem by populating a $self->{'items'} list with details of any items
added by KohaTest::add_biblios. Then, tests can probe there for the details of items
they should expect to find when searching.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
Here are a few improvments to the test suite to make it easier to write some tests
for C4::Items
I extracted "tomorrow" and "yesterday" methods from a test module into the base class
so that they could be used by multiple test modules
Adding callnumber to items added in the test suite.
I recatored KohaTest::add_biblios a bit to remove the manual count of the number of
MARC::Fields that were added.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
patch to C4::Members::ModMember to prevent it from deleting the dateofbirth field when none is supplied.
I also added a KohaTest::random_date method to help generate randomish dates for the test suite.
Added some tests for Member::ModMember. This is an easy method to test, and this bug shows that it
could use some closer examiniation.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This patch adds the misc/cronjobs/overdue_notices.pl script that is intended to replace
overduenotices.pl, overduenotices-30.pl and overduenotices-csv.pl. It adds messages to
the message_queue to be sent later (by process_message_queue.pl). It also marks borrowers
as debarred if their issues become too overdue.
It is intended to be run from cron nightly with usage something like:
0 2 * * * misc/cronjobs/overdue_notices.pl
C4::Members:
- improved documentation on ModMember
- made ModMember return a useful value (the return value of the database call)
- added a DebarMember method
- adding t/lib/KohaTest/Members/DebarMember.pm to test ModMember
misc/cronjobs/overdue_notices.pl
- designed to replace overduenotices.pl, overduenotices-30.pl, and overduenotice-csv
Changes to C4::Letters:
- EnqueueLetter now lets you pass in to_address and from_address which can override defaults
- _send_message_by_email pays attention to these defaults.
- now handles attachments with MIME::Lite
C4::Overdues
- added GetBranchcodesWithOverdueRules
- added t/lib/KohaTest/Overdues/GerBranchcodesWithOverdueRules.pm to test that.
circ/overdue.pl
- replaced call to obsolete overduenotices-csv.pl with call to overdue_notices.pl
KohaTest:
- added three helper methods: random_phone, random_email, random_ip
- these can be used to populate example records
- you can now pass an optional lengh to random_string
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
Added support for a new target in the test Makefile
to run a single test module. If you do (for example)
make test-single TEST_FILES=lib/KohaTest/Biblio.pm
only the tests in that module will be run. Unlike
the full test suite as run via 'make test', 'make test-single'
does not clear the test database before running the
tests.
Please note that "TEST_FILES=path/to/test/class.pm" is
required when using 'make test-single'.
Signed-off-by: Andrew Moore <andrew.moore@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
The add_biblios() routine now reindexes all bibs
in batch instead of waiting for zebraqueue_daemon - this
is moderately faster. A separate set of test
cases for zebraqueue_deamon will be witten.
No documentation changes.
Signed-off-by: Andrew Moore <andrew.moore@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
Defined a function attribute for KohaTest and subclasses
called 'Expensive'. When a test method has that attribute,
it is skipped unless the RUN_EXPENSIVE_TESTS environment
variable is true.
To mark a test method, expensive, do this:
sub test_foo : Tests(4) Expensive { ... }
To mark a whole class and its subclasses expensive,
define a SKIP_CLASS sub (with empty body) with the
Expensive attribute:
sub SKIP_CLASS : Expensive { }
Updated the t/Makefile so that 'make test' runs
nonexpensive tests, while 'make fulltest' runs both
cheap and expensive tests.
Marked KohaTest::Installer test class expensive.
Signed-off-by: Andrew Moore <andrew.moore@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
Moved routines to clear and create database and manage
zebraqueue_daemon.pl to KohaTest.pm so that they're
available to test classes - needed for installation
and upgrade tests in particular.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
Some minor changes to get the test suite working a bit better:
I removed a superfluous method from t/lib/KohaTest.pm.
I made each barcode for the items added in KohaTest.pm unique so that they would actually get inserted.
Then, I removed t/override_context_prefs.pm. If you need that functionality, you're a database
dependent test and should be a module in t/lib.
So, I deleted all of the trivial .t tests that just 'use'd their modules and had no other
tests and replaced them with lib/KohaTest/*pm modules that do a little bit more checking
on those modules.
I removed the references to override_context_prefs.pm in all of the other .t modules.
They all pass now with no override_context_prefs.pm module.
The database_depenedent.pl test script still does not pass entirely. There's a problem with the zebra index
not being reset each time that the tables are truncated. I'll get to that.
no functional or documentation changes here.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
I'm adding some functional tests that demonstrate that long_overdue.pl does what we think it does.
These tests don't actually work since override_context_prefs.pm gets in the way of C4::Context::preference. I opened up bug 2088 to address that.
There are no functional or documentation changes due to this patch.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
Removed the categorytable, mediatypetable, and subcategorytable
tables. These three tables appear to be from an incomplete
patch from pre-git that defined these tables to implement
additional search limits, and are not present in the 2.2.9
package. In 3.0, these tables did nothing - the only code that
referred to them are incomplete admin editors that lack HTML
templates and are not referred to anywhere.
The updatedatabase.pl logic to remove these tables is conservative;
the tables are dropped only if they exist and are all empty. Effectively,
this means that they'll be dropped if you've been running a fresh install
of 3.0 from git or the alphas or betas; if you've upgraded your database
from 2.2.9, these tables likely weren't in your database to begin with.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
KohaTest->reindex_marc() does a full Zebra reindexing of
bib and authority records and clears zebraqueue. It is
meant for use in test classes that do a lot of bib, authority,
and/or item record changes that would be slowed down by
waiting for zebraqueue_daemon.
Also adjusted list of tables that are automatically truncated.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
I'm adding some more warnings in Makefile.PL to indicate that you WILL lose the data
in your testing database.
I've also relaxed the requirement that the teting database have "test" in its name.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This patch makes the test suite work even when $PERL5LIB isn't set to the install directory.
It replaces $PERL5LIB with '..' in order to help ensure that we're loading the C4 libraries
out of the installation directory.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
These test libs should have been included in the previous patch.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>