Create test database schema from one or more SQL dump files.
This class can be useful to create test database schema when your schema is managed by tools external to your CakePHP application.
It is not well suited for applications/plugins that need to support multiple database platforms. You should use migrations for that instead.
Cake\TestSuite\ConnectionHelperConstructor.
Load and apply CakePHP-specific schema file.
Load and apply schema sql file, or an array of files.
__construct()
Constructor.
loadInternalFile(string $file, string $connectionName = 'test'): void
Load and apply CakePHP-specific schema file.
string $file Schema file
string $connectionName optional Connection name
voidloadSqlFiles(array<string>|string $paths, string $connectionName = 'test', bool $dropTables = true, bool $truncateTables = false): void
Load and apply schema sql file, or an array of files.
array<string>|string $paths Schema files to load
string $connectionName optional Connection name
bool $dropTables optional Drop all tables prior to loading schema files
bool $truncateTables optional Truncate all tables after loading schema files
voidCake\TestSuite\ConnectionHelper
© 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.SchemaLoader.html