4 * This file is part of the Behat.
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\Behat\Tester\Exception;
13 use Behat\Gherkin\Node\FeatureNode;
14 use Behat\Testwork\Exception\TestworkException;
18 * Represents exception throw during attempt to test non-existent feature background.
20 * @author Konstantin Kudryashov <ever.zet@gmail.com>
22 final class FeatureHasNoBackgroundException extends RuntimeException implements TestworkException
30 * Initializes exception.
32 * @param string $message
33 * @param FeatureNode $feature
35 public function __construct($message, FeatureNode $feature)
37 $this->feature = $feature;
39 parent::__construct($message);
43 * Returns feature that caused exception.
47 public function getFeature()
49 return $this->feature;