X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FTestwork%2FSuite%2FGenerator%2FGenericSuiteGenerator.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FTestwork%2FSuite%2FGenerator%2FGenericSuiteGenerator.php;h=36f6141c41148c251c73eee0587c948c4ef8dbad;hb=1270d9129ce8f27c9b28b10518e32132c58e0aca;hp=0000000000000000000000000000000000000000;hpb=c27c0f0cdaa3f354b1fe54a56ae7e854be6e3f68;p=yaffs-website diff --git a/vendor/behat/behat/src/Behat/Testwork/Suite/Generator/GenericSuiteGenerator.php b/vendor/behat/behat/src/Behat/Testwork/Suite/Generator/GenericSuiteGenerator.php new file mode 100644 index 000000000..36f6141c4 --- /dev/null +++ b/vendor/behat/behat/src/Behat/Testwork/Suite/Generator/GenericSuiteGenerator.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Behat\Testwork\Suite\Generator; + +use Behat\Testwork\Suite\GenericSuite; + +/** + * Generates generic test suites. + * + * @author Konstantin Kudryashov + */ +final class GenericSuiteGenerator implements SuiteGenerator +{ + /** + * @var array + */ + private $defaultSettings = array(); + + /** + * Initializes suite generator. + * + * @param array $defaultSettings + */ + public function __construct(array $defaultSettings = array()) + { + $this->defaultSettings = $defaultSettings; + } + + /** + * {@inheritdoc} + */ + public function supportsTypeAndSettings($type, array $settings) + { + return null === $type; + } + + /** + * {@inheritdoc} + */ + public function generateSuite($suiteName, array $settings) + { + return new GenericSuite($suiteName, $this->mergeDefaultSettings($settings)); + } + + /** + * Merges provided settings into default ones. + * + * @param array $settings + * + * @return array + */ + private function mergeDefaultSettings(array $settings) + { + return array_merge($this->defaultSettings, $settings); + } +}