Security update for permissions_by_term
[yaffs-website] / vendor / behat / behat / src / Behat / Testwork / Environment / Handler / StaticEnvironmentHandler.php
diff --git a/vendor/behat/behat/src/Behat/Testwork/Environment/Handler/StaticEnvironmentHandler.php b/vendor/behat/behat/src/Behat/Testwork/Environment/Handler/StaticEnvironmentHandler.php
new file mode 100644 (file)
index 0000000..6b399cc
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+
+/*
+ * This file is part of the Behat Testwork.
+ * (c) Konstantin Kudryashov <ever.zet@gmail.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Behat\Testwork\Environment\Handler;
+
+use Behat\Testwork\Environment\Environment;
+use Behat\Testwork\Environment\StaticEnvironment;
+use Behat\Testwork\Suite\Suite;
+
+/**
+ * Represents environment handler based on static calls (without any isolation).
+ *
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ */
+final class StaticEnvironmentHandler implements EnvironmentHandler
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function supportsSuite(Suite $suite)
+    {
+        return true;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function buildEnvironment(Suite $suite)
+    {
+        return new StaticEnvironment($suite);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function supportsEnvironmentAndSubject(Environment $environment, $testSubject = null)
+    {
+        return $environment instanceof StaticEnvironment;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function isolateEnvironment(Environment $environment, $testSubject = null)
+    {
+        return $environment;
+    }
+}