A factory class to manage the life cycle of test fixtures
_aliasConnections( )
Add aliases for all non test prefixed connections.
This allows models to use the test connections without a pile of configuration work.
_fixtureConnections( array $fixtures )
Get the unique list of connections that a set of fixtures contains.
$fixtures
array
_initDb( )
Initializes this class with a DataSource object to use as default for all fixtures
_loadFixtures( Cake\TestSuite\TestCase $test )
Looks for fixture files and instantiates the classes accordingly
Cake\TestSuite\TestCase
$test
UnexpectedValueException
_runOperation( array $fixtures , callable $operation )
Run a function on each connection and collection of fixtures.
$fixtures
$operation
_setupTable( Cake\TestSuite\Fixture\TestFixture $fixture , Cake\Database\Connection $db , array $sources , boolean $drop true )
Runs the drop and create commands on the fixtures if necessary.
Cake\TestSuite\Fixture\TestFixture
$fixture
Cake\Database\Connection
$db
$sources
$drop
optional true fixturize( Cake\TestSuite\TestCase $test )
Inspects the test to look for unloaded fixtures and loads them
Cake\TestSuite\TestCase
$test
isFixtureSetup( string $connection , Cake\Datasource\FixtureInterface $fixture )
Check whether or not a fixture has been inserted in a given connection name.
$connection
Cake\Datasource\FixtureInterface
$fixture
boolean
load( Cake\TestSuite\TestCase $test )
Creates the fixtures tables and inserts data on them.
Cake\TestSuite\TestCase
$test
Cake\Core\Exception\Exception
loadSingle( string $name , Cake\Datasource\ConnectionInterface $db null , boolean $dropTables true )
Creates a single fixture table and loads data into it.
$name
Cake\Datasource\ConnectionInterface
$db
optional null $dropTables
optional true UnexpectedValueException
setDebug( boolean $debug )
Modify the debug mode.
$debug
unload( Cake\TestSuite\TestCase $test )
Truncates the fixtures tables
Cake\TestSuite\TestCase
$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/3.1/class-Cake.TestSuite.Fixture.FixtureManager.html