1 | <?php |
||
25 | final class InitializedSymfonyExtensionEnvironment implements SymfonyExtensionEnvironment |
||
26 | { |
||
27 | /** @var Suite */ |
||
28 | private $suite; |
||
29 | |||
30 | /** @var Context[] */ |
||
31 | private $contexts = []; |
||
32 | |||
33 | public function __construct(Suite $suite) |
||
37 | |||
38 | public function registerContext(Context $context): void |
||
42 | |||
43 | public function getSuite(): Suite |
||
47 | |||
48 | public function bindCallee(Callee $callee): callable |
||
49 | { |
||
50 | $callable = $callee->getCallable(); |
||
51 | |||
52 | if (is_array($callable) && $callee->isAnInstanceMethod()) { |
||
53 | return [$this->getContext($callable[0]), $callable[1]]; |
||
54 | } |
||
55 | |||
56 | return $callable; |
||
57 | } |
||
58 | |||
59 | public function hasContexts(): bool |
||
63 | |||
64 | public function getContextClasses(): array |
||
68 | |||
69 | public function hasContextClass($class): bool |
||
73 | |||
74 | /** |
||
75 | * @see http://behat.org/en/latest/cookbooks/accessing_contexts_from_each_other.html |
||
76 | * |
||
77 | * @throws ContextNotFoundException |
||
78 | */ |
||
79 | public function getContext(string $class): Context |
||
90 | } |
||
91 |