FixturesStore
in package
uses
FixtureTrait
Table of Contents
Properties
- $data : mixed
- $_fixtures : array<string|int, mixed>
Methods
- __construct() : mixed
- Expects fixtures config
- fixtures() : mixed
- getFixture() : Fixture|null
- Returns the named fixture.
- getFixtures() : array<string|int, Fixture>
- Returns the fixture objects as specified in [[globalFixtures()]] and [[fixtures()]].
- globalFixtures() : mixed
- initFixtures() : mixed
- Initialize the fixtures.
- loadFixtures() : mixed
- Loads the specified fixtures.
- unloadFixtures() : mixed
- Unloads the specified fixtures.
- createFixtures() : array<string|int, Fixture>
- Creates the specified fixture instances.
Properties
$data
protected
mixed
$data
$_fixtures
private
array<string|int, mixed>
$_fixtures
the list of fixture objects available for the current test. The array keys are the corresponding fixture class names. The fixtures are listed in their dependency order. That is, fixture A is listed before B if B depends on A.
Methods
__construct()
Expects fixtures config
public
__construct(mixed $data) : mixed
FixturesStore constructor.
Parameters
- $data : mixed
fixtures()
public
fixtures() : mixed
getFixture()
Returns the named fixture.
public
getFixture(string $name) : Fixture|null
Parameters
- $name : string
-
the fixture name. This can be either the fixture alias name, or the class name if the alias is not used.
Return values
Fixture|null —the fixture object, or null if the named fixture does not exist.
getFixtures()
Returns the fixture objects as specified in [[globalFixtures()]] and [[fixtures()]].
public
getFixtures() : array<string|int, Fixture>
Return values
array<string|int, Fixture> —the loaded fixtures for the current test case
globalFixtures()
public
globalFixtures() : mixed
initFixtures()
Initialize the fixtures.
public
initFixtures() : mixed
Tags
loadFixtures()
Loads the specified fixtures.
public
loadFixtures([array<string|int, Fixture>|null $fixtures = null ]) : mixed
This method will call [[Fixture::load()]] for every fixture object.
Parameters
- $fixtures : array<string|int, Fixture>|null = null
-
the fixtures to be loaded. If this parameter is not specified, the return value of [[getFixtures()]] will be used.
unloadFixtures()
Unloads the specified fixtures.
public
unloadFixtures([array<string|int, Fixture>|null $fixtures = null ]) : mixed
This method will call [[Fixture::unload()]] for every fixture object.
Parameters
- $fixtures : array<string|int, Fixture>|null = null
-
the fixtures to be loaded. If this parameter is not specified, the return value of [[getFixtures()]] will be used.
createFixtures()
Creates the specified fixture instances.
protected
createFixtures(array<string|int, mixed> $fixtures) : array<string|int, Fixture>
All dependent fixtures will also be created. Duplicate fixtures and circular dependencies will only be created once.
Parameters
- $fixtures : array<string|int, mixed>
-
the fixtures to be created. You may provide fixture names or fixture configurations. If this parameter is not provided, the fixtures specified in [[globalFixtures()]] and [[fixtures()]] will be created.
Tags
Return values
array<string|int, Fixture> —the created fixture instances