1 | <?php |
||
24 | class IsolatedSessionStrategy implements ISessionStrategy |
||
25 | { |
||
26 | |||
27 | /** |
||
28 | * Session factory. |
||
29 | * |
||
30 | * @var ISessionFactory |
||
31 | */ |
||
32 | private $_sessionFactory; |
||
33 | |||
34 | /** |
||
35 | * Creates isolated session strategy instance. |
||
36 | * |
||
37 | * @param ISessionFactory $session_factory Session factory. |
||
38 | */ |
||
39 | 7 | public function __construct(ISessionFactory $session_factory) |
|
43 | |||
44 | /** |
||
45 | * Returns an array of event names this subscriber wants to listen to. |
||
46 | * |
||
47 | * @return array The event names to listen to |
||
48 | */ |
||
49 | 7 | public static function getSubscribedEvents() |
|
55 | |||
56 | /** |
||
57 | * Sets event dispatcher. |
||
58 | * |
||
59 | * @param EventDispatcherInterface $event_dispatcher Event dispatcher. |
||
60 | * |
||
61 | * @return void |
||
62 | */ |
||
63 | 7 | public function setEventDispatcher(EventDispatcherInterface $event_dispatcher) |
|
67 | |||
68 | /** |
||
69 | * Returns Mink session with given browser configuration. |
||
70 | * |
||
71 | * @param BrowserConfiguration $browser Browser configuration for a session. |
||
72 | * |
||
73 | * @return Session |
||
74 | */ |
||
75 | 1 | public function session(BrowserConfiguration $browser) |
|
79 | |||
80 | /** |
||
81 | * Called, when test ends. |
||
82 | * |
||
83 | * @param TestEvent $event Test event. |
||
84 | * |
||
85 | * @return void |
||
86 | */ |
||
87 | 3 | public function onTestEnd(TestEvent $event) |
|
99 | |||
100 | /** |
||
101 | * Checks, that event can be handled by this class. |
||
102 | * |
||
103 | * @param TestEvent $event Test event. |
||
104 | * |
||
105 | * @return boolean |
||
106 | */ |
||
107 | 3 | private function _isEventForMe(TestEvent $event) |
|
111 | } |
||
112 |