CiviEnvBuilder
in package
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.
Table of Contents
Properties
- $name : mixed
- $steps : mixed
- $targetSignature : string|null
Methods
- __construct() : mixed
- addStep() : mixed
- apply() : CiviEnvBuilder
- Determine if there's been a change in the preferred configuration.
- callback() : mixed
- coreSchema() : CiviEnvBuilder
- Generate the core SQL tables.
- install() : CiviEnvBuilder
- Require that an extension be installed.
- installMe() : CiviEnvBuilder
- Require an extension be installed (identified by its directory).
- sql() : mixed
- sqlFile() : mixed
- uninstall() : CiviEnvBuilder
- Require an extension be uninstalled.
- uninstallMe() : CiviEnvBuilder
- Require an extension be uninstalled (identified by its directory).
- assertValid() : mixed
- getSavedSignature() : string
- getTargetSignature() : string
- setSavedSignature() : mixed
- whoAmI() : null
Properties
$name
protected
mixed
$name
$steps
private
mixed
$steps
= []
$targetSignature
private
string|null
$targetSignature
= NULL
A digest of the values in $steps.
Methods
__construct()
public
__construct([string $name = 'CiviEnvBuilder' ]) : mixed
Parameters
- $name : string = 'CiviEnvBuilder'
addStep()
public
addStep(StepInterface $step) : mixed
Parameters
- $step : StepInterface
apply()
Determine if there's been a change in the preferred configuration.
public
apply([bool $force = FALSE ]) : CiviEnvBuilder
If the preferred-configuration matches the last test, keep it. Otherwise, destroy and recreate.
Parameters
- $force : bool = FALSE
-
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 values
CiviEnvBuildercallback()
public
callback(mixed $callback[, mixed $signature = NULL ]) : mixed
Parameters
- $callback : mixed
- $signature : mixed = NULL
coreSchema()
Generate the core SQL tables.
public
coreSchema() : CiviEnvBuilder
Return values
CiviEnvBuilderinstall()
Require that an extension be installed.
public
install(string|array<string|int, mixed> $names) : CiviEnvBuilder
Parameters
- $names : string|array<string|int, mixed>
-
One or more extension names. You may use a wildcard '*'.
Return values
CiviEnvBuilderinstallMe()
Require an extension be installed (identified by its directory).
public
installMe(string $dir) : CiviEnvBuilder
Parameters
- $dir : string
-
The current test directory. We'll search for info.xml to see what this extension is.
Tags
Return values
CiviEnvBuildersql()
public
sql(mixed $sql) : mixed
Parameters
- $sql : mixed
sqlFile()
public
sqlFile(mixed $file) : mixed
Parameters
- $file : mixed
uninstall()
Require an extension be uninstalled.
public
uninstall(string|array<string|int, mixed> $names) : CiviEnvBuilder
Parameters
- $names : string|array<string|int, mixed>
-
One or more extension names. You may use a wildcard '*'.
Return values
CiviEnvBuilderuninstallMe()
Require an extension be uninstalled (identified by its directory).
public
uninstallMe(string $dir) : CiviEnvBuilder
Parameters
- $dir : string
-
The current test directory. We'll search for info.xml to see what this extension is.
Tags
Return values
CiviEnvBuilderassertValid()
protected
assertValid() : mixed
getSavedSignature()
protected
getSavedSignature() : string
Return values
stringgetTargetSignature()
protected
getTargetSignature() : string
Return values
stringsetSavedSignature()
protected
setSavedSignature(mixed $newSignature) : mixed
Parameters
- $newSignature : mixed
whoAmI()
protected
whoAmI(mixed $dir) : null
Parameters
- $dir : mixed