NAME

Daizu::Test - functions for use by the test suite

DESCRIPTION

The functions defined in here are only really useful for testing Daizu CMS. This stuff is used by the test suite, in particular t/00setup.t which creates a test database and repository.

CONSTANTS

$TEST_DB_NAME

Name of database to use for testing.

Value: daizu_test

$DB_SCHEMA_FILENAME

Name of the SQL file containing the database schema to load into the test database after creating it.

Value: db.sql

$TEST_REPOS_DIR

Full path to the directory which should contain the testing repository created at the start of running the tests.

Value: .test-repos in the current directory

$TEST_REPOS_URL

A 'file' URL to the test repository.

$TEST_REPOS_DUMP

Full path to the Subversion dump file which is loaded into the test repository.

Value: test-repos.dump in the current directory.

$TEST_DOCROOT_DIR

Full path to the directory into which output from publishing test content should be written.

Value: .test-docroot in the current directory

$TEST_CONFIG

Filename of config file to use for testing.

Value: test-config.xml (which is created from test-config.xml.tmpl by t/00setup.t)

FUNCTIONS

The following functions are available for export from this module. None of them are exported by default.

pg_template_dbh()

Returns a DBI database handle connected to the PostgreSQL template1 database, which can be used for example to create the test database.

create_database()

Create the test database, load the database schema into it, and return a DBI handle for accessing it.

drop_database()

Delete the test database. Sleeps for a second before doing so, to give the connections a chance to really get cleaned up.

editor_set_file_content($ed, $file_baton, $content)

Send some data from $content (which should be a reference to a string) into the Subversion delta editor $ed. $file_baton should be the baton returned from the editor when you called its add_file or open_file method.

create_test_repos()

Create an empty Subversion repository for testing, in $TEST_REPOS_DIR.

COPYRIGHT

This software is copyright 2006 Geoff Richards <geoff@laxan.com>. For licensing information see this page:

http://www.daizucms.org/license/