4 * This file is part of the Behat Gherkin.
5 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
11 namespace Behat\Gherkin\Node;
14 * Represents Gherkin Scenario.
16 * @author Konstantin Kudryashov <ever.zet@gmail.com>
18 class ScenarioNode implements ScenarioInterface
27 private $tags = array();
31 private $steps = array();
42 * Initializes scenario.
44 * @param null|string $title
46 * @param StepNode[] $steps
47 * @param string $keyword
48 * @param integer $line
50 public function __construct($title, array $tags, array $steps, $keyword, $line)
52 $this->title = $title;
54 $this->steps = $steps;
55 $this->keyword = $keyword;
60 * Returns node type string
64 public function getNodeType()
70 * Returns scenario title.
74 public function getTitle()
80 * Checks if scenario is tagged with tag.
86 public function hasTag($tag)
88 return in_array($tag, $this->getTags());
92 * Checks if scenario has tags (both inherited from feature and own).
96 public function hasTags()
98 return 0 < count($this->getTags());
102 * Returns scenario tags (including inherited from feature).
106 public function getTags()
112 * Checks if scenario has steps.
116 public function hasSteps()
118 return 0 < count($this->steps);
122 * Returns scenario steps.
126 public function getSteps()
132 * Returns scenario keyword.
136 public function getKeyword()
138 return $this->keyword;
142 * Returns scenario declaration line number.
146 public function getLine()