A factory class to manage the life cycle of test fixtures
_initDb( )
Initializes this class with a DataSource object to use as default for all fixtures
_loadFixtures( array $fixtures )
Looks for fixture files and instantiates the classes accordingly
$fixtures
UnexpectedValueException
_parseFixturePath( string $fixturePath )
Parse the fixture path included in test cases, to get the fixture class name, and the real fixture path including sub-directories
$fixturePath
array
_setupTable( CakeTestFixture $fixture , DataSource $db null , boolean $drop true )
Runs the drop and create commands on the fixtures if necessary.
CakeTestFixture
$fixture
DataSource
$db
optional null $drop
optional true fixturize( CakeTestCase $test )
Inspects the test to look for unloaded fixtures and loads them
CakeTestCase
$test
load( CakeTestCase $test )
Creates the fixtures tables and inserts data on them.
CakeTestCase
$test
loadSingle( string $name , DataSource $db null , boolean $dropTables true )
Creates a single fixture table and loads data into it.
$name
DataSource
$db
optional null $dropTables
optional true UnexpectedValueException
shutDown( )
Drop all fixture tables loaded by this class
This will also close the session, as failing to do so will cause fatal errors with database sessions.
unload( CakeTestCase $test )
Truncates the fixtures tables
CakeTestCase
$test
© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
http://api.cakephp.org/2.7/class-CakeFixtureManager.html