class FixtureTestState implements TestState (View source)

Properties

protected bool $loaded

Set if fixtures have been loaded

Methods

public
setUp(SapphireTest $test)

Called on setup

public
tearDown(SapphireTest $test)

Called on tear down

public
setUpOnce(string $class)

Called once on setup

public
tearDownOnce(string $class)

Called once on tear down

public
getFixtureFactory(string $class)

No description

public
setFixtureFactory(FixtureFactory $factory, string $class)

No description

protected
array
getFixturePaths(array $fixtures, SapphireTest $test)

No description

protected
loadFixtures(SapphireTest $test)

No description

protected
loadFixture(string $fixtureFile, SapphireTest $test)

No description

protected
string
resolveFixturePath(string $fixtureFilePath, SapphireTest $test)

Map a fixture path to a physical file

protected
string
getTestAbsolutePath(SapphireTest $test)

Useful for writing unit tests without hardcoding folder structures.

protected
bool
testNeedsDB(SapphireTest $test)

No description

protected
resetFixtureFactory(string $class)

Bootstrap a clean fixture factory for the given class

protected
bool
getIsLoaded(string $class)

Check if fixtures need to be loaded for this class

Details

setUp(SapphireTest $test)

Called on setup

Parameters

SapphireTest $test

tearDown(SapphireTest $test)

Called on tear down

Parameters

SapphireTest $test

setUpOnce(string $class)

Called once on setup

Parameters

string $class

Class being setup

tearDownOnce(string $class)

Called once on tear down

Parameters

string $class

Class being torn down

bool|FixtureFactory getFixtureFactory(string $class)

No description

Parameters

string $class

Return Value

bool|FixtureFactory

setFixtureFactory(FixtureFactory $factory, string $class)

No description

Parameters

FixtureFactory $factory
string $class

protected array getFixturePaths(array $fixtures, SapphireTest $test)

No description

Parameters

array $fixtures
SapphireTest $test

Return Value

array

protected loadFixtures(SapphireTest $test)

No description

Parameters

SapphireTest $test

protected loadFixture(string $fixtureFile, SapphireTest $test)

No description

Parameters

string $fixtureFile
SapphireTest $test

protected string resolveFixturePath(string $fixtureFilePath, SapphireTest $test)

Map a fixture path to a physical file

Parameters

string $fixtureFilePath
SapphireTest $test

Return Value

string

protected string getTestAbsolutePath(SapphireTest $test)

Useful for writing unit tests without hardcoding folder structures.

Parameters

SapphireTest $test

Return Value

string

Absolute path to current class.

protected bool testNeedsDB(SapphireTest $test)

No description

Parameters

SapphireTest $test

Return Value

bool

protected resetFixtureFactory(string $class)

Bootstrap a clean fixture factory for the given class

Parameters

string $class

protected bool getIsLoaded(string $class)

Check if fixtures need to be loaded for this class

Parameters

string $class

Name of test to check

Return Value

bool