class CiviEnvBuilder

Class CiviEnvBuilder

Provides a fluent interface for tracking a set of steps. By computing and storing a signature for the list steps, we can determine whether to (a) do nothing with the list or (b) reapply all the steps.

Properties

protected $name

Methods

__construct($name)

No description

addStep(StepInterface $step)

No description

callback($callback, $signature = NULL)

No description

sql($sql)

No description

sqlFile($file)

No description

install(string|array $names)

Require that an extension be installed.

installMe(string $dir)

Require an extension be installed (identified by its directory).

uninstall(string|array $names)

Require an extension be uninstalled.

uninstallMe(string $dir)

Require an extension be uninstalled (identified by its directory).

assertValid()

No description

string
getTargetSignature()

No description

string
getSavedSignature()

No description

setSavedSignature($newSignature)

No description

apply(bool $force = FALSE)

Determine if there's been a change in the preferred configuration.

null
whoAmI($dir)

No description

Details

at line 30
__construct($name)

Parameters

$name

at line 34
addStep(StepInterface $step)

Parameters

StepInterface $step

at line 40
callback($callback, $signature = NULL)

Parameters

$callback
$signature

at line 44
sql($sql)

Parameters

$sql

at line 48
sqlFile($file)

Parameters

$file

at line 59
CiviEnvBuilder install(string|array $names)

Require that an extension be installed.

Parameters

string|array $names One or more extension names. You may use a wildcard '*'.

Return Value

CiviEnvBuilder

at line 72
CiviEnvBuilder installMe(string $dir)

Require an extension be installed (identified by its directory).

Parameters

string $dir The current test directory. We'll search for info.xml to see what this extension is.

Return Value

CiviEnvBuilder

Exceptions

CRM_Extension_Exception_ParseException

at line 83
CiviEnvBuilder uninstall(string|array $names)

Require an extension be uninstalled.

Parameters

string|array $names One or more extension names. You may use a wildcard '*'.

Return Value

CiviEnvBuilder

at line 96
CiviEnvBuilder uninstallMe(string $dir)

Require an extension be uninstalled (identified by its directory).

Parameters

string $dir The current test directory. We'll search for info.xml to see what this extension is.

Return Value

CiviEnvBuilder

Exceptions

CRM_Extension_Exception_ParseException

at line 100
protected assertValid()

at line 111
protected string getTargetSignature()

Return Value

string

at line 126
protected string getSavedSignature()

Return Value

string

at line 143
protected setSavedSignature($newSignature)

Parameters

$newSignature

at line 170
CiviEnvBuilder apply(bool $force = FALSE)

Determine if there's been a change in the preferred configuration.

If the preferred-configuration matches the last test, keep it. Otherwise, destroy and recreate.

Parameters

bool $force Forcibly execute the build, even if the configuration hasn't changed. This will slow-down the tests, but it may be appropriate for some very sloppy tests.

Return Value

CiviEnvBuilder

at line 196
protected null whoAmI($dir)

Parameters

$dir

Return Value

null

Exceptions

CRM_Extension_Exception_ParseException