| @@ 272-279 (lines=8) @@ | ||
| 269 | )); |
|
| 270 | } |
|
| 271 | ||
| 272 | if (!$node instanceof ScenarioNode) { |
|
| 273 | throw new ParserException(sprintf( |
|
| 274 | 'Expected Scenario, Outline or Background, but got %s on line: %d%s', |
|
| 275 | $node->getNodeType(), |
|
| 276 | $node->getLine(), |
|
| 277 | $this->file ? ' in file: ' . $this->file : '' |
|
| 278 | )); |
|
| 279 | } |
|
| 280 | } |
|
| 281 | ||
| 282 | return new FeatureNode( |
|
| @@ 347-354 (lines=8) @@ | ||
| 344 | )); |
|
| 345 | } |
|
| 346 | ||
| 347 | if (!$node instanceof StepNode) { |
|
| 348 | throw new ParserException(sprintf( |
|
| 349 | 'Expected Step, but got %s on line: %d%s', |
|
| 350 | $node->getNodeType(), |
|
| 351 | $node->getLine(), |
|
| 352 | $this->file ? ' in file: ' . $this->file : '' |
|
| 353 | )); |
|
| 354 | } |
|
| 355 | } |
|
| 356 | ||
| 357 | return new BackgroundNode(rtrim($title) ?: null, $steps, $keyword, $line); |
|
| @@ 406-413 (lines=8) @@ | ||
| 403 | )); |
|
| 404 | } |
|
| 405 | ||
| 406 | if (!$node instanceof StepNode) { |
|
| 407 | throw new ParserException(sprintf( |
|
| 408 | 'Expected Step, but got %s on line: %d%s', |
|
| 409 | $node->getNodeType(), |
|
| 410 | $node->getLine(), |
|
| 411 | $this->file ? ' in file: ' . $this->file : '' |
|
| 412 | )); |
|
| 413 | } |
|
| 414 | } |
|
| 415 | ||
| 416 | array_pop($this->passedNodesStack); |
|
| @@ 477-484 (lines=8) @@ | ||
| 474 | )); |
|
| 475 | } |
|
| 476 | ||
| 477 | if (!$node instanceof StepNode) { |
|
| 478 | throw new ParserException(sprintf( |
|
| 479 | 'Expected Step or Examples table, but got %s on line: %d%s', |
|
| 480 | $node->getNodeType(), |
|
| 481 | $node->getLine(), |
|
| 482 | $this->file ? ' in file: ' . $this->file : '' |
|
| 483 | )); |
|
| 484 | } |
|
| 485 | } |
|
| 486 | ||
| 487 | if (empty($examples)) { |
|