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\Setup\SuiteSetup;
16 * Configures provided suites using registered suite setups.
18 * @author Konstantin Kudryashov <ever.zet@gmail.com>
20 final class SuiteBootstrapper
25 private $setups = array();
28 * Registers suite setup.
30 * @param SuiteSetup $setup
32 public function registerSuiteSetup(SuiteSetup $setup)
34 $this->setups[] = $setup;
38 * Bootstraps provided suites using registered setups.
40 * @param Suite[] $suites
42 public function bootstrapSuites(array $suites)
44 array_map(array($this, 'bootstrapSuite'), $suites);
48 * Bootstraps provided suite using registered setup.
52 public function bootstrapSuite(Suite $suite)
54 foreach ($this->setups as $setup) {
55 if ($setup->supportsSuite($suite)) {
56 $setup->setupSuite($suite);