$_initialized
$_initialized : boolean
Was this instance already initialized?
A factory class to manage the life cycle of test fixtures
$_loaded : array<mixed,\Cake\Datasource\FixtureInterface>
Holds the fixture classes that where instantiated
$_fixtureMap : array<mixed,\Cake\Datasource\FixtureInterface>
Holds the fixture classes that where instantiated indexed by class name
fixturize(\Cake\TestSuite\TestCase $test) : void
Inspects the test to look for unloaded fixtures and loads them
\Cake\TestSuite\TestCase | $test | The test case to inspect. |
load(\Cake\TestSuite\TestCase $test) : void
Creates the fixtures tables and inserts data on them.
\Cake\TestSuite\TestCase | $test | The test to inspect for fixture loading. |
When fixture records cannot be inserted.
unload(\Cake\TestSuite\TestCase $test) : void
Truncates the fixtures tables
\Cake\TestSuite\TestCase | $test | The test to inspect for fixture unloading. |
loadSingle(string $name, \Cake\Datasource\ConnectionInterface|null $db = null, boolean $dropTables = true) : void
Creates a single fixture table and loads data into it.
string | $name | of the fixture |
\Cake\Datasource\ConnectionInterface|null | $db | Connection instance or leave null to get a Connection from the fixture |
boolean | $dropTables | Whether or not tables should be dropped and re-created. |
if $name is not a previously loaded class
isFixtureSetup(string $connection, \Cake\Datasource\FixtureInterface $fixture) : boolean
Check whether or not a fixture has been inserted in a given connection name.
string | $connection | The connection name. |
\Cake\Datasource\FixtureInterface | $fixture | The fixture to check. |
_loadFixtures(\Cake\TestSuite\TestCase $test) : void
Looks for fixture files and instantiates the classes accordingly
\Cake\TestSuite\TestCase | $test | The test suite to load fixtures for. |
when a referenced fixture does not exist.
_setupTable(\Cake\Datasource\FixtureInterface $fixture, \Cake\Database\Connection $db, array $sources, boolean $drop = true) : void
Runs the drop and create commands on the fixtures if necessary.
\Cake\Datasource\FixtureInterface | $fixture | the fixture object to create |
\Cake\Database\Connection | $db | The Connection object instance to use |
array | $sources | The existing tables in the datasource. |
boolean | $drop | whether drop the fixture if it is already created or not |
Loading…