Security update for permissions_by_term
[yaffs-website] / vendor / drupal / drupal-extension / src / Drupal / DrupalExtension / Hook / Scope / BaseEntityScope.php
1 <?php
2 /**
3  * @file
4  * Entity scope.
5  */
6 namespace Drupal\DrupalExtension\Hook\Scope;
7
8 use Behat\Behat\Context\Context;
9 use Behat\Testwork\Environment\Environment;
10 use Behat\Testwork\Hook\Scope\HookScope;
11
12 /**
13  * Represents an Entity hook scope.
14  */
15 abstract class BaseEntityScope implements EntityScope {
16
17   /**
18    * @var Environment
19    */
20   private $environment;
21
22   /**
23    * Context object.
24    *
25    * @var \Behat\Behat\Context\Context
26    */
27   private $context;
28
29   /**
30    * Entity object.
31    */
32   private $entity;
33
34   /**
35    * Initializes the scope.
36    */
37   public function __construct(Environment $environment, Context $context, $entity) {
38     $this->context = $context;
39     $this->entity = $entity;
40     $this->environment = $environment;
41   }
42
43   /**
44    * Returns the context.
45    *
46    * @return \Behat\Behat\Context\Context
47    */
48   public function getContext() {
49     return $this->context;
50   }
51
52   /**
53    * Returns the entity object.
54    */
55   public function getEntity() {
56     return $this->entity;
57   }
58
59   /**
60    * {@inheritDoc}
61    */
62   public function getEnvironment() {
63     return $this->environment;
64   }
65
66   /**
67    * {@inheritDoc}
68    */
69   public function getSuite() {
70     return $this->environment->getSuite();
71   }
72 }