Security update for permissions_by_term
[yaffs-website] / vendor / drupal / drupal-extension / src / Drupal / DrupalExtension / Hook / Scope / BaseEntityScope.php
diff --git a/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Hook/Scope/BaseEntityScope.php b/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Hook/Scope/BaseEntityScope.php
new file mode 100644 (file)
index 0000000..055e153
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+/**
+ * @file
+ * Entity scope.
+ */
+namespace Drupal\DrupalExtension\Hook\Scope;
+
+use Behat\Behat\Context\Context;
+use Behat\Testwork\Environment\Environment;
+use Behat\Testwork\Hook\Scope\HookScope;
+
+/**
+ * Represents an Entity hook scope.
+ */
+abstract class BaseEntityScope implements EntityScope {
+
+  /**
+   * @var Environment
+   */
+  private $environment;
+
+  /**
+   * Context object.
+   *
+   * @var \Behat\Behat\Context\Context
+   */
+  private $context;
+
+  /**
+   * Entity object.
+   */
+  private $entity;
+
+  /**
+   * Initializes the scope.
+   */
+  public function __construct(Environment $environment, Context $context, $entity) {
+    $this->context = $context;
+    $this->entity = $entity;
+    $this->environment = $environment;
+  }
+
+  /**
+   * Returns the context.
+   *
+   * @return \Behat\Behat\Context\Context
+   */
+  public function getContext() {
+    return $this->context;
+  }
+
+  /**
+   * Returns the entity object.
+   */
+  public function getEntity() {
+    return $this->entity;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  public function getEnvironment() {
+    return $this->environment;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  public function getSuite() {
+    return $this->environment->getSuite();
+  }
+}