A factory class to manage the life cycle of test fixtures
$_debug protected booleanIs the test runner being run with --debug enabled. When true, fixture SQL will also be logged.
$_fixtureMap protected $_initialized protected boolean$_insertionMap protected array$_loaded protected $_processed protected array_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 _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 _runOperation( array $fixtures , callable $operation )
Run a function on each connection and collection of fixtures.
$fixtures $operation _setupTable( Cake\Datasource\FixtureInterface $fixture , Cake\Database\Connection $db , array $sources , boolean $drop = true )
Runs the drop and create commands on the fixtures if necessary.
Cake\Datasource\FixtureInterface $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 load( Cake\TestSuite\TestCase $test )
Creates the fixtures tables and inserts data on them.
Cake\TestSuite\TestCase $test Cake\Core\Exception\ExceptionloadSingle( string $name , Cake\Datasource\ConnectionInterface|null $db = null , boolean $dropTables = true )
Creates a single fixture table and loads data into it.
$name Cake\Datasource\ConnectionInterface|null $db optional null $dropTables optional true setDebug( boolean $debug )
Modify the debug mode.
$debug unload( Cake\TestSuite\TestCase $test )
Truncates the fixtures tables
Cake\TestSuite\TestCase $test protected boolean
Is the test runner being run with --debug enabled. When true, fixture SQL will also be logged.
false
protected Cake\Datasource\FixtureInterface[]
Holds the fixture classes that where instantiated indexed by class name
[]
protected Cake\Datasource\FixtureInterface[]
Holds the fixture classes that where instantiated
[]
© 2005–present 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.
https://api.cakephp.org/3.8/class-Cake.TestSuite.Fixture.FixtureManager.html