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\Generator;
13 use Behat\Testwork\Suite\GenericSuite;
16 * Generates generic test suites.
18 * @author Konstantin Kudryashov <ever.zet@gmail.com>
20 final class GenericSuiteGenerator implements SuiteGenerator
25 private $defaultSettings = array();
28 * Initializes suite generator.
30 * @param array $defaultSettings
32 public function __construct(array $defaultSettings = array())
34 $this->defaultSettings = $defaultSettings;
40 public function supportsTypeAndSettings($type, array $settings)
42 return null === $type;
48 public function generateSuite($suiteName, array $settings)
50 return new GenericSuite($suiteName, $this->mergeDefaultSettings($settings));
54 * Merges provided settings into default ones.
56 * @param array $settings
60 private function mergeDefaultSettings(array $settings)
62 return array_merge($this->defaultSettings, $settings);