1Wiki::Toolkit::TestLib(U3s)er Contributed Perl DocumentatWiiokni::Toolkit::TestLib(3)
2
3
4

NAME

6       Wiki::Toolkit::TestLib - Utilities for writing Wiki::Toolkit tests.
7

DESCRIPTION

9       When 'perl Makefile.PL' is run on a Wiki::Toolkit distribution,
10       information will be gathered about test databases etc that can be used
11       for running tests. Wiki::Toolkit::TestLib gives convenient access to
12       this information.
13

SYNOPSIS

15         use strict;
16         use Wiki::Toolkit::TestLib;
17         use Test::More;
18
19         my $iterator = Wiki::Toolkit::TestLib->new_wiki_maker;
20         plan tests => ( $iterator->number * 6 );
21
22         while ( my $wiki = $iterator->new_wiki ) {
23             # put some test data in
24             # run six tests
25         }
26
27       Each time you call "->next" on your iterator, you will get a fresh
28       blank wiki object. The iterator will iterate over all configured search
29       and storage backends.
30
31       The Lucy search backend will be configured to index three metadata
32       fields: address, category, and locale.
33

METHODS

35       new_wiki_maker
36             my $iterator = Wiki::Toolkit::TestLib->new_wiki_maker;
37
38       number
39             use Test::More;
40             my $iterator = Wiki::Toolkit::TestLib->new_wiki_maker;
41             plan tests => ( $iterator->number * 6 );
42
43           Returns the number of new wikis that your iterator will be able to
44           give you.
45
46       new_wiki
47             my $wiki = $iterator->new_wiki;
48
49           Returns a fresh blank wiki object, or false if you've used up all
50           the configured search and storage backends.
51
52       configured_databases
53             my @configured_databases = $iterator->configured_databases;
54
55             Returns the @configured_databases array detailing configured test databases.
56             Useful for very low-level testing only.
57

SEE ALSO

59       Wiki::Toolkit
60

AUTHOR

62       Kake Pugh (kake@earth.li).
63
65            Copyright (C) 2003-2004 Kake Pugh.  All Rights Reserved.
66            Copyright (C) 2008 the Wiki::Toolkit team. All Rights Reserved.
67
68       This module is free software; you can redistribute it and/or modify it
69       under the same terms as Perl itself.
70

CAVEATS

72       If you have the Search::InvertedIndex backend configured (see
73       Wiki::Toolkit::Search::SII) then your tests will raise warnings like
74
75         (in cleanup) Search::InvertedIndex::DB::Mysql::lock() -
76           testdb is not open. Can't lock.
77         at /usr/local/share/perl/5.6.1/Search/InvertedIndex.pm line 1348
78
79       or
80
81         (in cleanup) Can't call method "sync" on an undefined value
82           at /usr/local/share/perl/5.6.1/Tie/DB_File/SplitHash.pm line 331
83           during global destruction.
84
85       in unexpected places. I don't know whether this is a bug in me or in
86       Search::InvertedIndex.
87
88
89
90perl v5.34.0                      2022-01-21         Wiki::Toolkit::TestLib(3)
Impressum