|Inheritance||yii\elasticsearch\ActiveFixture » yii\test\BaseActiveFixture|
|Available since version||2.0.2|
ActiveFixture represents a fixture for testing backed up by anor an elastic search index.
After the fixture is loaded, you can access the loaded data via theproperty. If you set , you will also be able to retrieve an instance of with the populated data via .
|$dataFile||string|boolean||The file path or path alias of the data file that contains the fixture data to be returned by getData().||yii\elasticsearch\ActiveFixture|
|$db||yii\elasticsearch\Connection|string||The DB connection object or the application component ID of the DB connection.||yii\elasticsearch\ActiveFixture|
|$index||string||The name of the index that this fixture is about.||yii\elasticsearch\ActiveFixture|
|$type||string||The name of the type that this fixture is about.||yii\elasticsearch\ActiveFixture|
|load()||Loads the fixture.||yii\elasticsearch\ActiveFixture|
|getData()||Returns the fixture data.||yii\elasticsearch\ActiveFixture|
|resetIndex()||Removes all existing data from the specified index and type.||yii\elasticsearch\ActiveFixture|
The file path or path alias of the data file that contains the fixture data
to be returned by getData(). If this is not set, it will default to
FixturePath stands for the directory containing this fixture class,
Index stands for the elasticsearch $index name
Type stands for the $type associated with this fixture.
You can set this property to be false to prevent loading any data.
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.
The name of the index that this fixture is about. If this property is not set, the name will be determined via.
The name of the type that this fixture is about. If this property is not set, the name will be determined via.
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 an array of data rows (column name => column value), each corresponding to a row in the index.
If the data file does not exist, an empty array will be returned.
|protected array getData ( )|
The data rows to be inserted into the database index.
|public void init ( )|
Loads the fixture.
If you override this method, you should consider calling the parent implementation so that the data returned by getData() can be populated into the index.
|public void load ( )|
Removes all existing data from the specified index and type.
This method is called before populating fixture data into the index associated with this fixture.
|protected void resetIndex ( )|