The DBTestCase class exists as a convenience for writing test cases
that require a database. Creating and/or resetting a database for each test involves significant overhead, so confining that behavior to this class allows that to be skipped for test cases that don't require it (test cases that inherit directly from CriticalI_TestCase).
This class includes a number of special behaviors. By default it connects to or creates a SQLite database named .db in the current directory. A different database can be used by overriding the connection() method.
Once the database connection has been established, the class looks for a directory named schema. Any files ending in .sql in the schema directory are assumed to contain table creation statements and to be named for the table they created. Any table with the same is dropped, and the contents of the .sql file are sent to the database.
For each test that is run, the class looks for a directory named fixtures. Any files ending in .ini in the fixtures directory are assumed to also be named for their corresponding tables. The table for each file is truncated, the data in the fixture file is loaded into the database, and the data becomes available by calling the fixture method with the fixture name and key.
Located in /Core/lib/CriticalI/DBTestCase.php (line 31)
PHPUnit_Framework_TestCase | --CriticalI_TestCase | --CriticalI_DBTestCase
Builds the INSERT SQL statement for a set of fixture data
Return the database connection
Return the data for a named fixture
Set up the schema, if needed
Set up the fixtures
Does the work of loading data from the fixture files
Override the run method to allow additional prep
Return the path to the test directory.
Inherited From CriticalI_TestCase
CriticalI_TestCase::__construct()
Documentation generated on Wed, 25 Apr 2012 09:46:42 -0700 by phpDocumentor 1.4.3