NAME

Test::DB::Mysql - Temporary Testing Databases for Mysql

ABSTRACT

Temporary Mysql Database for Testing

SYNOPSIS

package main;

use Test::DB::Mysql;

my $tdbo = Test::DB::Mysql->new;

# my $dbh = $tdbo->create->dbh;

DESCRIPTION

This package provides methods for generating and destroying Mysql databases for testing purposes. The attributes can be set using their respective environment variables: TESTDB_DATABASE, TESTDB_USERNAME, TESTDB_PASSWORD, TESTDB_HOSTNAME, and TESTDB_HOSTPORT.

INHERITS

This package inherits behaviors from:

Test::DB::Object

INTEGRATES

This package integrates behaviors from:

Data::Object::Role::Buildable

Data::Object::Role::Immutable

Data::Object::Role::Stashable

LIBRARIES

This package uses type constraints from:

Types::Standard

ATTRIBUTES

This package has the following attributes:

database

database(Str)

This attribute is read-only, accepts (Str) values, and is optional.

dbh

dbh(Object)

This attribute is read-only, accepts (Object) values, and is optional.

dsn

dsn(Str)

This attribute is read-only, accepts (Str) values, and is optional.

hostname

hostname(Str)

This attribute is read-only, accepts (Str) values, and is optional.

hostport

hostport(Str)

This attribute is read-only, accepts (Str) values, and is optional.

password

password(Str)

This attribute is read-only, accepts (Str) values, and is optional.

uri

uri(Str)

This attribute is read-only, accepts (Str) values, and is optional.

username

username(Str)

This attribute is read-only, accepts (Str) values, and is optional.

METHODS

This package implements the following methods:

create

create() : Object

The create method creates a temporary database and returns the invocant.

create example #1
# given: synopsis

$tdbo->create;

# <Test::DB::Mysql>

destroy

destroy() : Object

The destroy method destroys (drops) the database and returns the invocant.

destroy example #1
# given: synopsis

$tdbo->create;
$tdbo->destroy;

# <Test::DB::Mysql>

AUTHOR

Al Newkirk, awncorp@cpan.org

LICENSE

Copyright (C) 2011-2019, Al Newkirk, et al.

This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file".

PROJECT

Wiki

Project

Initiatives

Milestones

Contributing

Issues