Security update for permissions_by_term
[yaffs-website] / vendor / behat / behat / src / Behat / Testwork / Environment / Handler / StaticEnvironmentHandler.php
1 <?php
2
3 /*
4  * This file is part of the Behat Testwork.
5  * (c) Konstantin Kudryashov <ever.zet@gmail.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 namespace Behat\Testwork\Environment\Handler;
12
13 use Behat\Testwork\Environment\Environment;
14 use Behat\Testwork\Environment\StaticEnvironment;
15 use Behat\Testwork\Suite\Suite;
16
17 /**
18  * Represents environment handler based on static calls (without any isolation).
19  *
20  * @author Konstantin Kudryashov <ever.zet@gmail.com>
21  */
22 final class StaticEnvironmentHandler implements EnvironmentHandler
23 {
24     /**
25      * {@inheritdoc}
26      */
27     public function supportsSuite(Suite $suite)
28     {
29         return true;
30     }
31
32     /**
33      * {@inheritdoc}
34      */
35     public function buildEnvironment(Suite $suite)
36     {
37         return new StaticEnvironment($suite);
38     }
39
40     /**
41      * {@inheritdoc}
42      */
43     public function supportsEnvironmentAndSubject(Environment $environment, $testSubject = null)
44     {
45         return $environment instanceof StaticEnvironment;
46     }
47
48     /**
49      * {@inheritdoc}
50      */
51     public function isolateEnvironment(Environment $environment, $testSubject = null)
52     {
53         return $environment;
54     }
55 }