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 Background.
16 * @author Konstantin Kudryashov <ever.zet@gmail.com>
18 class BackgroundNode implements ScenarioLikeInterface
27 private $steps = array();
38 * Initializes background.
40 * @param null|string $title
41 * @param StepNode[] $steps
42 * @param string $keyword
43 * @param integer $line
45 public function __construct($title, array $steps, $keyword, $line)
47 $this->title = $title;
48 $this->steps = $steps;
49 $this->keyword = $keyword;
54 * Returns node type string
58 public function getNodeType()
64 * Returns background title.
68 public function getTitle()
74 * Checks if background has steps.
78 public function hasSteps()
80 return 0 < count($this->steps);
84 * Returns background steps.
88 public function getSteps()
94 * Returns background keyword.
98 public function getKeyword()
100 return $this->keyword;
104 * Returns background declaration line number.
108 public function getLine()