PHP Class Pantheon\Terminus\FeatureTests\FeatureContext

Inheritance: implements Behat\Behat\Context\Context
Datei anzeigen Open project: pantheon-systems/terminus

Public Properties

Property Type Description
$cliroot

Public Methods

Method Description
__construct ( [array] $parameters ) : [void] Initializes context
aSiteNamed ( string $site ) : boolean Ensures a site of the given name exists
aSiteNamedBelongingTo ( [string] $site, [string] $org ) : [boolean] Ensures a site of the given name exists and belongs to given org
before ( [ScenarioEvent] $event ) : [void]
connectionMode ( [string] $site, [string] $mode = null ) : [void] Changes or displays mode, given or not, of given site
iAddToTheTeamOn ( [string] $email, [string] $site ) : [void] Adds $email user from $site
iAmAuthenticated ( ) : [void] Logs in user with username and password set in behat.yml And a blank slate cache
iAmPrompted ( [string] $prompt, [string] $site, [string] $url = "https://[[dashboard_host]]/" ) : [void]
iCheckTheListOfEnvironmentsOn ( [string] $site ) : [string]
iCheckTheUrlForValidity ( [string] $url ) : [void] Checks to see if a URL is valid
iCheckTheUserAmLoggedInAs ( ) : [void] Checks which user Terminus is operating as
iClearTheCaches ( [string] $env, [string] $site ) : [void] Clears site caches
iCloneTheEnvironment ( [string] $from_env, [string] $to_env, [string] $site ) : [void]
iCommitChanges ( [string] $env, [string] $site, [string] $message ) : [void] Commits changes to given site's given env with given message
iCreateMultidevEnv ( [string] $multidev, [string] $env, [string] $site ) : [void] Creates a multidev env of given name on given site cloning given env
iCreateSiteNamed ( [string] $upstream, [string] $name, [string] $org = false ) : [void] Creates a site for the given name
iDeleteTheSiteNamed ( [string] $site ) : [void] Deletes a site of the given name
iDeployTheEnvironmentOf ( [string] $env, [string] $from, [string] $site, [string] $message ) : [void]
iEnterInput ( )
iExpireMySession ( ) : [void] Intentionally expires the user's session
iGetInfoForTheEnvironmentOf ( [string] $env, [string] $site ) : [string] Queries for info for a given site
iGetInfoForTheSite ( [string] $site ) : [string] Queries for info for a given site
iHaveAtLeastSite ( [integer] $min ) : [boolean] Checks which user Terminus is operating as
iHaveNoSavedMachineTokens ( ) : boolean Removes all machine tokens from the running machine
iHaveSavedMachineTokens ( integer $num_tokens ) : boolean Ensures at least X machine tokens exist in the tokens directory
iHaveSites ( [integer] $num ) : [boolean] Checks which user Terminus is operating as
iInitializeTheEnvironmentOn ( [string] $env, [string] $site ) : [void]
iInstallTheModuleTo ( [string] $module, [string] $site ) : [void] Installs given module to given Drupal site
iListTheBackupsOf ( [string] $env, [string] $site ) : [string] List the backups of the given environment of the given site
iListTheSites ( ) : [void] Lists all sites user is on the team of
iListTheTeamMembersOn ( [string] $site ) : [void] Lists team members
iLogIn ( [string] $token = '[[machine_token]]' ) : [void] Logs in user
iLogInAs ( [string] $email = '[[username]]' ) : [void] Logs in a user with a locally saved machine token
iLogOut ( ) : [void] Logs user out
iMakeBackupElementsOfTheEnvironment ( [string] $elements, [string] $env, [string] $site ) : [void] Makes a backup of given elements of given site's given environment
iMergeTheEnvironment ( [string] $from_env, [string] $to_env, [string] $site ) : [void]
iRemoveFromTheTeamOn ( [string] $email, [string] $site ) : [void] Removes $email user from $site
iRestoreTheEnvironmentOfFromBackup ( [string] $env, [string] $site ) : [void]
iRun ( [string] $command ) : [string]
iShouldGet ( [string] $string ) : [boolean]
iShouldGetOneOfTheFollowing ( [array] $list_string ) : [boolean]
iShouldGetValidUuid ( ) : boolean
iShouldHaveNewBackup ( ) : [boolean] Checks for backups made since the test started running
iShouldHaveRecords ( [integer] $number ) : [void] Checks the number of records returned against a given quantity
iShouldNotGet ( [string] $string ) : [boolean] Ensures that you do not recieve param $string as result
iShouldNotGetOneOfTheFollowing ( [array] $list_string ) : [boolean]
iShouldSeeAProgressBarWithTheMessage ( $message )
isMemberOfTheTeamOn ( [string] $member, [string] $site ) : [boolean] Ensures that a user is not on a site's team
isNotMemberOfTheTeamOn ( [string] $member, [string] $site ) : [boolean] Ensures that a user is not on a site's team
noSiteNamed ( [string] $site ) : [boolean] Ensures there is no site with the given name. Loops until this is so
serviceLevel ( [string] $site, [string] $service_level = null ) : [void] Gets or sets service level
setTestStatus ( [string] $status ) : [boolean] Automatically assigns pass/fail/skip to the test result
shouldSeeATableWithHeaders ( string $headers ) : boolean Checks the output for a table with the given headers
shouldSeeATableWithRows ( $rows ) : boolean Checks the output for a table with the given row values
shouldSeeATypeOfMessage ( $type, $message = null ) : boolean Checks the output for a type of message. Message to match is optional.
thisStepIsPending ( string $description )

Private Methods

Method Description
checkResult ( [string] $needle, [string] $haystack ) : [boolean] Checks the the haystack for the needle
getTags ( [ScenarioEvent] $event ) Returns tags in easy-to-use array format.
openInBrowser ( [string] $url ) : [void] Opens param $url in the default browser
read ( ) : [string] Reads one line from STDIN
replacePlaceholders ( [string] $string, [array] $replacements = [] ) : [string] Exchanges values in given string with square brackets for values in $this->parameters
setCassetteName ( [array] $event ) : [string] Sets $this->cassette_name and returns name of the cassette to be used.

Method Details

__construct() public method

Initializes context
public __construct ( [array] $parameters ) : [void]
$parameters [array]
return [void]

aSiteNamed() public method

Ensures a site of the given name exists
public aSiteNamed ( string $site ) : boolean
$site string Name of site to ensure exists
return boolean Always true, else errs

aSiteNamedBelongingTo() public method

Ensures a site of the given name exists and belongs to given org
public aSiteNamedBelongingTo ( [string] $site, [string] $org ) : [boolean]
$site [string]
$org [string]
return [boolean]

before() public method

public before ( [ScenarioEvent] $event ) : [void]
$event [ScenarioEvent]
return [void]

connectionMode() public method

Changes or displays mode, given or not, of given site
public connectionMode ( [string] $site, [string] $mode = null ) : [void]
$site [string]
$mode [string]
return [void]

iAddToTheTeamOn() public method

Adds $email user from $site
public iAddToTheTeamOn ( [string] $email, [string] $site ) : [void]
$email [string]
$site [string]
return [void]

iAmAuthenticated() public method

Logs in user with username and password set in behat.yml And a blank slate cache
public iAmAuthenticated ( ) : [void]
return [void]

iAmPrompted() public method

public iAmPrompted ( [string] $prompt, [string] $site, [string] $url = "https://[[dashboard_host]]/" ) : [void]
$prompt [string]
$site [string]
$url [string]
return [void]

iCheckTheListOfEnvironmentsOn() public method

public iCheckTheListOfEnvironmentsOn ( [string] $site ) : [string]
$site [string]
return [string]

iCheckTheUrlForValidity() public method

Checks to see if a URL is valid
public iCheckTheUrlForValidity ( [string] $url ) : [void]
$url [string]
return [void]

iCheckTheUserAmLoggedInAs() public method

Checks which user Terminus is operating as
public iCheckTheUserAmLoggedInAs ( ) : [void]
return [void]

iClearTheCaches() public method

Clears site caches
public iClearTheCaches ( [string] $env, [string] $site ) : [void]
$env [string]
$site [string]
return [void]

iCloneTheEnvironment() public method

public iCloneTheEnvironment ( [string] $from_env, [string] $to_env, [string] $site ) : [void]
$from_env [string]
$to_env [string]
$site [string]
return [void]

iCommitChanges() public method

Commits changes to given site's given env with given message
public iCommitChanges ( [string] $env, [string] $site, [string] $message ) : [void]
$env [string]
$site [string]
$message [string]
return [void]

iCreateMultidevEnv() public method

Creates a multidev env of given name on given site cloning given env
public iCreateMultidevEnv ( [string] $multidev, [string] $env, [string] $site ) : [void]
$multidev [string]
$env [string]
$site [string]
return [void]

iCreateSiteNamed() public method

Creates a site for the given name
public iCreateSiteNamed ( [string] $upstream, [string] $name, [string] $org = false ) : [void]
$upstream [string]
$name [string]
$org [string]
return [void]

iDeleteTheSiteNamed() public method

Deletes a site of the given name
public iDeleteTheSiteNamed ( [string] $site ) : [void]
$site [string]
return [void]

iDeployTheEnvironmentOf() public method

public iDeployTheEnvironmentOf ( [string] $env, [string] $from, [string] $site, [string] $message ) : [void]
$env [string]
$from [string]
$site [string]
$message [string]
return [void]

iEnterInput() public method

public iEnterInput ( )

iExpireMySession() public method

Intentionally expires the user's session
public iExpireMySession ( ) : [void]
return [void]

iGetInfoForTheEnvironmentOf() public method

Queries for info for a given site
public iGetInfoForTheEnvironmentOf ( [string] $env, [string] $site ) : [string]
$env [string]
$site [string]
return [string]

iGetInfoForTheSite() public method

Queries for info for a given site
public iGetInfoForTheSite ( [string] $site ) : [string]
$site [string]
return [string]

iHaveAtLeastSite() public method

Checks which user Terminus is operating as
public iHaveAtLeastSite ( [integer] $min ) : [boolean]
$min [integer]
return [boolean]

iHaveNoSavedMachineTokens() public method

Removes all machine tokens from the running machine

iHaveSavedMachineTokens() public method

Ensures at least X machine tokens exist in the tokens directory
public iHaveSavedMachineTokens ( integer $num_tokens ) : boolean
$num_tokens integer Number of tokens to ensure exist
return boolean

iHaveSites() public method

Checks which user Terminus is operating as
public iHaveSites ( [integer] $num ) : [boolean]
$num [integer]
return [boolean]

iInitializeTheEnvironmentOn() public method

public iInitializeTheEnvironmentOn ( [string] $env, [string] $site ) : [void]
$env [string]
$site [string]
return [void]

iInstallTheModuleTo() public method

Installs given module to given Drupal site
public iInstallTheModuleTo ( [string] $module, [string] $site ) : [void]
$module [string]
$site [string]
return [void]

iListTheBackupsOf() public method

List the backups of the given environment of the given site
public iListTheBackupsOf ( [string] $env, [string] $site ) : [string]
$env [string]
$site [string]
return [string]

iListTheSites() public method

Lists all sites user is on the team of
public iListTheSites ( ) : [void]
return [void]

iListTheTeamMembersOn() public method

Lists team members
public iListTheTeamMembersOn ( [string] $site ) : [void]
$site [string]
return [void]

iLogIn() public method

Logs in user
public iLogIn ( [string] $token = '[[machine_token]]' ) : [void]
$token [string]
return [void]

iLogInAs() public method

Logs in a user with a locally saved machine token
public iLogInAs ( [string] $email = '[[username]]' ) : [void]
$email [string]
return [void]

iLogOut() public method

Logs user out
public iLogOut ( ) : [void]
return [void]

iMakeBackupElementsOfTheEnvironment() public method

Makes a backup of given elements of given site's given environment
public iMakeBackupElementsOfTheEnvironment ( [string] $elements, [string] $env, [string] $site ) : [void]
$elements [string]
$env [string]
$site [string]
return [void]

iMergeTheEnvironment() public method

public iMergeTheEnvironment ( [string] $from_env, [string] $to_env, [string] $site ) : [void]
$from_env [string]
$to_env [string]
$site [string]
return [void]

iRemoveFromTheTeamOn() public method

Removes $email user from $site
public iRemoveFromTheTeamOn ( [string] $email, [string] $site ) : [void]
$email [string]
$site [string]
return [void]

iRestoreTheEnvironmentOfFromBackup() public method

public iRestoreTheEnvironmentOfFromBackup ( [string] $env, [string] $site ) : [void]
$env [string]
$site [string]
return [void]

iRun() public method

public iRun ( [string] $command ) : [string]
$command [string]
return [string]

iShouldGet() public method

public iShouldGet ( [string] $string ) : [boolean]
$string [string]
return [boolean]

iShouldGetOneOfTheFollowing() public method

public iShouldGetOneOfTheFollowing ( [array] $list_string ) : [boolean]
$list_string [array]
return [boolean]

iShouldGetValidUuid() public method

public iShouldGetValidUuid ( ) : boolean
return boolean

iShouldHaveNewBackup() public method

Checks for backups made since the test started running
public iShouldHaveNewBackup ( ) : [boolean]
return [boolean]

iShouldHaveRecords() public method

Checks the number of records returned against a given quantity
public iShouldHaveRecords ( [integer] $number ) : [void]
$number [integer]
return [void]

iShouldNotGet() public method

Ensures that you do not recieve param $string as result
public iShouldNotGet ( [string] $string ) : [boolean]
$string [string]
return [boolean]

iShouldNotGetOneOfTheFollowing() public method

public iShouldNotGetOneOfTheFollowing ( [array] $list_string ) : [boolean]
$list_string [array]
return [boolean]

iShouldSeeAProgressBarWithTheMessage() public method

isMemberOfTheTeamOn() public method

Ensures that a user is not on a site's team
public isMemberOfTheTeamOn ( [string] $member, [string] $site ) : [boolean]
$member [string]
$site [string]
return [boolean]

isNotMemberOfTheTeamOn() public method

Ensures that a user is not on a site's team
public isNotMemberOfTheTeamOn ( [string] $member, [string] $site ) : [boolean]
$member [string]
$site [string]
return [boolean]

noSiteNamed() public method

Ensures there is no site with the given name. Loops until this is so
public noSiteNamed ( [string] $site ) : [boolean]
$site [string]
return [boolean]

serviceLevel() public method

Gets or sets service level
public serviceLevel ( [string] $site, [string] $service_level = null ) : [void]
$site [string]
$service_level [string]
return [void]

setTestStatus() public method

Automatically assigns pass/fail/skip to the test result
public setTestStatus ( [string] $status ) : [boolean]
$status [string]
return [boolean]

shouldSeeATableWithHeaders() public method

Checks the output for a table with the given headers
public shouldSeeATableWithHeaders ( string $headers ) : boolean
$headers string Comma separated row values to match
return boolean true if $headers exists in output

shouldSeeATableWithRows() public method

Checks the output for a table with the given row values
public shouldSeeATableWithRows ( $rows ) : boolean
$rows string newline separated row values to match
return boolean true if all of the rows are present in the output

shouldSeeATypeOfMessage() public method

Checks the output for a type of message. Message to match is optional.
public shouldSeeATypeOfMessage ( $type, $message = null ) : boolean
$type string One of the standard logging levels
$message string Optional message to match in the output
return boolean True if message is the correct type and exists in output if given

thisStepIsPending() public method

public thisStepIsPending ( string $description )
$description string feature description of what is still pending

Property Details

$cliroot public_oe property

public $cliroot