A factory class to manage the life cycle of test fixtures
boolIs the test runner being run with --debug enabled. When true, fixture SQL will also be logged.
arrayCake\Datasource\FixtureInterface>Holds the fixture classes that where instantiated indexed by class name
boolWas this instance already initialized?
array<string, arrayCake\Datasource\FixtureInterface>>A map of connection names and the fixture currently in it.
arrayCake\Datasource\FixtureInterface>Holds the fixture classes that where instantiated
array<string, bool>List of TestCase class name that have been processed
Add aliases for all non test prefixed connections.
Get the unique list of connections that a set of fixtures contains.
Initializes this class with a DataSource object to use as default for all fixtures
Looks for fixture files and instantiates the classes accordingly
Run a function on each connection and collection of fixtures.
Runs the drop and create commands on the fixtures if necessary.
Check whether a fixture has been inserted in a given connection name.
Modify the debug mode.
Drop all fixture tables loaded by this class
Truncates the fixtures tables
_aliasConnections(): void
Add aliases for all non test prefixed connections.
This allows models to use the test connections without a pile of configuration work.
void_fixtureConnections(array<string> $fixtures): array
Get the unique list of connections that a set of fixtures contains.
array<string> $fixtures The array of fixtures a list of connections is needed from.
array_initDb(): void
Initializes this class with a DataSource object to use as default for all fixtures
void_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.
voidUnexpectedValueException_runOperation(array<string> $fixtures, callable $operation): void
Run a function on each connection and collection of fixtures.
array<string> $fixtures A list of fixtures to operate on.
callable $operation The operation to run on each connection + fixture set.
void_setupTable(Cake\Datasource\FixtureInterface $fixture, Cake\Datasource\ConnectionInterface $db, array<string> $sources, bool $drop = true): void
Runs the drop and create commands on the fixtures if necessary.
Cake\Datasource\FixtureInterface $fixture the fixture object to create
Cake\Datasource\ConnectionInterface $db The Connection object instance to use
array<string> $sources The existing tables in the datasource.
bool $drop optional whether drop the fixture if it is already created or not
voidfixturize(Cake\TestSuite\TestCase $test): void
Cake\TestSuite\TestCase $test Test case
voidgetInserted(): array<string>
array<string>isFixtureSetup(string $connection, Cake\Datasource\FixtureInterface $fixture): bool
Check whether a fixture has been inserted in a given connection name.
string $connection The connection name.
Cake\Datasource\FixtureInterface $fixture The fixture to check.
boolload(Cake\TestSuite\TestCase $test): void
Cake\TestSuite\TestCase $test Test case
voidRuntimeExceptionloadSingle(string $name, Cake\Datasource\ConnectionInterface|null $connection = null, bool $dropTables = true): void
string $name Name
Cake\Datasource\ConnectionInterface|null $connection optional Connection
bool $dropTables optional Drop all tables prior to loading schema files
voidUnexpectedValueExceptionloaded(): Cake\Datasource\FixtureInterface[]
Cake\Datasource\FixtureInterface[]setDebug(bool $debug): void
Modify the debug mode.
bool $debug Whether fixture debug mode is enabled.
voidshutDown(): void
Drop all fixture tables loaded by this class
voidunload(Cake\TestSuite\TestCase $test): void
Truncates the fixtures tables
Cake\TestSuite\TestCase $test The test to inspect for fixture unloading.
voidIs the test runner being run with --debug enabled. When true, fixture SQL will also be logged.
boolHolds the fixture classes that where instantiated indexed by class name
arrayCake\Datasource\FixtureInterface>Was this instance already initialized?
boolA map of connection names and the fixture currently in it.
array<string, arrayCake\Datasource\FixtureInterface>>Holds the fixture classes that where instantiated
arrayCake\Datasource\FixtureInterface>List of TestCase class name that have been processed
array<string, bool>
© 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/4.4/class-Cake.TestSuite.Fixture.FixtureManager.html