FeatureNode
in package
implements
KeywordNodeInterface, TaggedNodeInterface
Represents Gherkin Feature.
Tags
Table of Contents
Interfaces
- KeywordNodeInterface
- Gherkin keyword node interface.
- TaggedNodeInterface
- Gherkin tagged node interface.
Properties
- $background : null|BackgroundNode
- $description : null|string
- $file : null|string
- $keyword : string
- $language : string
- $line : int
- $scenarios : array<string|int, ScenarioInterface>
- $tags : array<string|int, string>
- $title : null|string
Methods
- __construct() : mixed
- Initializes feature.
- getBackground() : null|BackgroundNode
- Returns feature background.
- getDescription() : null|string
- Returns feature description.
- getFile() : null|string
- Returns feature file as an absolute path.
- getKeyword() : string
- Returns feature keyword.
- getLanguage() : string
- Returns feature language.
- getLine() : int
- Returns feature declaration line number.
- getNodeType() : string
- Returns node type string
- getScenarios() : array<string|int, ScenarioInterface>
- Returns feature scenarios.
- getTags() : array<string|int, string>
- Returns feature tags.
- getTitle() : null|string
- Returns feature title.
- hasBackground() : bool
- Checks if feature has background.
- hasDescription() : bool
- Checks if feature has a description.
- hasScenarios() : bool
- Checks if feature has scenarios.
- hasTag() : bool
- Checks if feature is tagged with tag.
- hasTags() : bool
- Checks if feature has tags.
- isAbsolutePath() : bool
- Returns whether the file path is an absolute path.
Properties
$background
private
null|BackgroundNode
$background
$description
private
null|string
$description
$file
private
null|string
$file
$keyword
private
string
$keyword
$language
private
string
$language
$line
private
int
$line
$scenarios
private
array<string|int, ScenarioInterface>
$scenarios
= array()
$tags
private
array<string|int, string>
$tags
= array()
$title
private
null|string
$title
Methods
__construct()
Initializes feature.
public
__construct(null|string $title, null|string $description, array<string|int, string> $tags[, null|BackgroundNode $background = null ], array<string|int, ScenarioInterface> $scenarios, string $keyword, string $language, null|string $file, int $line) : mixed
Parameters
- $title : null|string
- $description : null|string
- $tags : array<string|int, string>
- $background : null|BackgroundNode = null
- $scenarios : array<string|int, ScenarioInterface>
- $keyword : string
- $language : string
- $file : null|string
-
The absolute path to the feature file.
- $line : int
getBackground()
Returns feature background.
public
getBackground() : null|BackgroundNode
Return values
null|BackgroundNodegetDescription()
Returns feature description.
public
getDescription() : null|string
Return values
null|stringgetFile()
Returns feature file as an absolute path.
public
getFile() : null|string
Return values
null|stringgetKeyword()
Returns feature keyword.
public
getKeyword() : string
Return values
stringgetLanguage()
Returns feature language.
public
getLanguage() : string
Return values
stringgetLine()
Returns feature declaration line number.
public
getLine() : int
Return values
intgetNodeType()
Returns node type string
public
getNodeType() : string
Return values
stringgetScenarios()
Returns feature scenarios.
public
getScenarios() : array<string|int, ScenarioInterface>
Return values
array<string|int, ScenarioInterface>getTags()
Returns feature tags.
public
getTags() : array<string|int, string>
Return values
array<string|int, string>getTitle()
Returns feature title.
public
getTitle() : null|string
Return values
null|stringhasBackground()
Checks if feature has background.
public
hasBackground() : bool
Return values
boolhasDescription()
Checks if feature has a description.
public
hasDescription() : bool
Return values
boolhasScenarios()
Checks if feature has scenarios.
public
hasScenarios() : bool
Return values
boolhasTag()
Checks if feature is tagged with tag.
public
hasTag(string $tag) : bool
Parameters
- $tag : string
Return values
boolhasTags()
Checks if feature has tags.
public
hasTags() : bool
Return values
boolisAbsolutePath()
Returns whether the file path is an absolute path.
protected
isAbsolutePath(string $file) : bool
Parameters
- $file : string
-
A file path