test\DbFixture init()

init() public method Initializes the object. This method is invoked at the end of the constructor after the object is initialized with the given configuration. public void init ( )

test\DbFixture $db

$db public property The DB connection object or the application component ID of the DB connection. After the DbFixture object is created, if you want to change this property, you should only assign it with a DB connection object. Starting from version 2.0.2, this can also be a configuration array for creating the object. public yii\db\Connection|array|string $db = 'db'

test\BaseActiveFixture $modelClass

$modelClass public property The AR model class associated with this fixture. public string $modelClass = null

test\BaseActiveFixture getModel()

getModel() public method Returns the AR model by the specified model name. A model name is the key of the corresponding data row in $data. public null|yii\db\ActiveRecord getModel ( $name )$name string The model name. return null|yii\db\ActiveRecord The AR model, or null if the model cannot be found in the database throws yii\base\InvalidConfigException if $modelClass is not set.

test\BaseActiveFixture load()

load() public method Loads the fixture. The default implementation simply stores the data returned by getData() in $data. You should usually override this method by putting the data into the underlying database. public void load ( )

test\BaseActiveFixture getData()

getData() protected method Returns the fixture data. The default implementation will try to return the fixture data by including the external file specified by $dataFile. The file should return the data array that will be stored in $data after inserting into the database. protected array getData ( )return array The data to be put into the database throws yii\base\InvalidConfigException if the specified data file does not exist.

test\BaseActiveFixture $dataFile

$dataFile public property The file path or path alias of the data file that contains the fixture data to be returned by getData(). You can set this property to be false to prevent loading any data. public string|boolean $dataFile = null

test\BaseActiveFixture $data

$data public property The data rows. Each array element represents one row of data (column name => column value). public array $data = []

test\ArrayFixture unload()

unload() public method Unloads the fixture. This method is called after every test method finishes. You may override this method to perform necessary cleanup work for the fixture. public void unload ( )

test\ArrayFixture load()

load() public method Loads the fixture. The default implementation simply stores the data returned by getData() in $data. You should usually override this method by putting the data into the underlying database. public void load ( )