4 * This file is part of the Behat Testwork.
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\Testwork\Suite;
13 use Behat\Testwork\Suite\Exception\ParameterNotFoundException;
16 * Represents generic (no specific attributes) test suite.
18 * @author Konstantin Kudryashov <ever.zet@gmail.com>
20 final class GenericSuite implements Suite
29 private $settings = array();
35 * @param array $settings
37 public function __construct($name, array $settings)
40 $this->settings = $settings;
44 * Returns unique suite name.
48 public function getName()
54 * Returns suite settings.
58 public function getSettings()
60 return $this->settings;
64 * Checks if a setting with provided name exists.
70 public function hasSetting($key)
72 return array_key_exists($key, $this->settings);
76 * Returns setting value by its key.
82 * @throws ParameterNotFoundException If setting is not set
84 public function getSetting($key)
86 if (!$this->hasSetting($key)) {
87 throw new ParameterNotFoundException(sprintf(
88 '`%s` suite does not have a `%s` setting.',
91 ), $this->getName(), $key);
94 return $this->settings[$key];