Method | Description | |
---|---|---|
__construct ( |
Create CommitAsserter to start tracking the git repo for future asserts. Should generally be called after a test setup (if there is any) and before all the actual work. Asserts follow after it. | |
assertBulkAction ( string $expectedAction, integer $expectedCountOfGroupedActions ) | Asserts that commit is a bulk action. Asserts the action and number of grouped change info objects. | |
assertCleanWorkingDirectory ( ) | ||
assertCommitAction ( string $expectedAction, integer $whichCommit, boolean $regardlessOfPriority = false ) | Asserts that the recorded commit if of certain type, e.g. "post/edit". By default inspects the most recent commit; if this asserter captured more commits $whichCommit specifies which commit to assert against. | |
assertCommitPath ( string $type, string $path, integer $whichCommit ) | Asserts that commit affected some path. Paths support wildcards and two placeholders: | |
assertCommitPaths ( $changes, integer $whichCommit ) | Calls {@link assertCommitPath} for every item of given array. | |
assertCommitTag ( $tagKey, $tagValue ) | ||
assertCommitsAreEquivalent ( integer $whichCommit, integer $referenceCommit ) | Asserts that two commits are "equivalent". Equivalent means that they both captured the same action over the same entity and that the captured VP tags are the same set (values may differ). | |
assertCountOfAffectedFiles ( integer $count, integer $whichCommit ) | Asserts that commit affected exact number of files (no matter the type). | |
assertCountOfUntrackedFiles ( $count ) | ||
assertNumCommits ( integer $numExpectedCommits ) | Asserts that the number of commits made since the constructor matches the given number. | |
ignoreCommits ( string | string[] $action ) | Ignores commits of given action(s) | |
reset ( ) |
Method | Description | |
---|---|---|
getChangeInfo ( |
Method | Description | |
---|---|---|
expandPath ( $path, $whichCommit ) : mixed | ||
getCommit ( integer $whichCommit ) : |
||
getNonIgnoredCommits ( ) : |
Use this to fetch all the commits since $startCommit that are not ignored. | |
getRevRange ( integer $whichCommit ) : string | Converts $whichCommit (int) to a Git rev range |
public __construct ( |
||
$gitRepository | ||
$dbSchema | ||
$actionsInfoProvider | ||
$pathPlaceholders | string[] |
public assertBulkAction ( string $expectedAction, integer $expectedCountOfGroupedActions ) | ||
$expectedAction | string | Expected action, e.g., "post/edit" or "plugin/activate". |
$expectedCountOfGroupedActions | integer |
public assertCommitAction ( string $expectedAction, integer $whichCommit, boolean $regardlessOfPriority = false ) | ||
$expectedAction | string | Expected action, e.g., "post/edit" or "wordpress/update". |
$whichCommit | integer | See $whichCommitParameter documentation. "HEAD" by default. |
$regardlessOfPriority | boolean | By default, commit action must be the "main" one in the envelope (with the highest priority). If this param is set to true the whole envelope is searched for the given action. |
public assertCommitPath ( string $type, string $path, integer $whichCommit ) | ||
$type | string | Standard git "M" (modified), "A" (added), "D" (deleted) etc. or array of actions for more possibilities. |
$path | string | Path relative to repo root. Supports wildcards, e.g. "wp-content/uploads/*", and placeholders, e.g., "%vpdb%/posts/%VPID%.ini" |
$whichCommit | integer | See $whichCommitParameter documentation. "HEAD" by default. |
public assertCommitPaths ( $changes, integer $whichCommit ) | ||
$changes | ||
$whichCommit | integer | See $whichCommitParameter documentation. "HEAD" by default. |
public assertCommitsAreEquivalent ( integer $whichCommit, integer $referenceCommit ) | ||
$whichCommit | integer | See $whichCommitParameter documentation. "HEAD" by default. |
$referenceCommit | integer | See $whichCommitParameter documentation. "HEAD^" by default. |
public assertCountOfAffectedFiles ( integer $count, integer $whichCommit ) | ||
$count | integer | Expected count of affected files. |
$whichCommit | integer | See $whichCommitParameter documentation. "HEAD" by default. |
public assertNumCommits ( integer $numExpectedCommits ) | ||
$numExpectedCommits | integer |
protected getChangeInfo ( |
||
$commit | ||
return |
public ignoreCommits ( string | string[] $action ) | ||
$action | string | string[] | An action like "usermeta/edit", or an array of them |