PHP Class yii\test\InitDbFixture
Its main task is to toggle integrity check of the database during data loading.
This is needed by other DB-related fixtures (e.g.
ActiveFixture) so that they can populate
data into the database without triggering integrity check errors.
Besides, DbFixture also attempts to load an [[initScript|initialization script]] if it exists.
You should normally use InitDbFixture to prepare a skeleton test database.
Other DB fixtures will then add specific tables and data to this database.
For more details and usage information on InitDbFixture, see the
guide article on fixtures.
Afficher le fichier
Open project: yiisoft/yii2
Class Usage Examples
Méthodes publiques
Свойство |
Type |
Description |
|
$initScript |
|
the init script file that should be executed when loading this fixture.
This should be either a file path or path alias. Note that if the file does not exist,
no error will be raised. |
|
$schemas |
|
list of database schemas that the test tables may reside in. Defaults to
[''], meaning using the default schema (an empty string refers to the
default schema). This property is mainly used when turning on and off integrity checks
so that fixture data can be populated into the database without causing problem. |
|
Méthodes publiques
Method Details
afterLoad()
public méthode
afterUnload()
public méthode
beforeLoad()
public méthode
beforeUnload()
public méthode
checkIntegrity()
public méthode
Toggles the DB integrity check.
Property Details
$initScript public_oe property
the init script file that should be executed when loading this fixture.
This should be either a file path or path alias. Note that if the file does not exist,
no error will be raised.
$schemas public_oe property
list of database schemas that the test tables may reside in. Defaults to
[''], meaning using the default schema (an empty string refers to the
default schema). This property is mainly used when turning on and off integrity checks
so that fixture data can be populated into the database without causing problem.