1 | <?php |
||
14 | class FeatureContext implements SnippetAcceptingContext |
||
15 | { |
||
16 | /** |
||
17 | * @var \Redis |
||
18 | */ |
||
19 | private $redis; |
||
20 | |||
21 | /** |
||
22 | * @var RedisCache |
||
23 | */ |
||
24 | private $backend; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | private $result; |
||
30 | |||
31 | /** |
||
32 | * @var Container |
||
33 | */ |
||
34 | private $pimple; |
||
35 | |||
36 | /** |
||
37 | * FeatureContext constructor. |
||
38 | */ |
||
39 | public function __construct() |
||
46 | |||
47 | /** |
||
48 | * @BeforeScenario |
||
49 | */ |
||
50 | public function reset() |
||
54 | |||
55 | /** |
||
56 | * @Given The cache is empty |
||
57 | */ |
||
58 | public function theCacheIsEmpty() |
||
62 | |||
63 | /** |
||
64 | * @Given I store a an item in the cache |
||
65 | */ |
||
66 | public function iStoreAAnItemInTheCache() |
||
70 | |||
71 | /** |
||
72 | * @When I retrieve it |
||
73 | */ |
||
74 | public function whenIRetrieved() |
||
78 | |||
79 | /** |
||
80 | * @Then I should get the same item |
||
81 | */ |
||
82 | public function iShouldGetTheSameItem() |
||
88 | |||
89 | /** |
||
90 | * @param $timeToLive |
||
91 | * |
||
92 | * @Given I store a an item in the cache for :timeToLive second |
||
93 | */ |
||
94 | public function iStoreAAnItemInTheCacheForSecond($timeToLive) |
||
98 | |||
99 | /** |
||
100 | * @param $seconds |
||
101 | * |
||
102 | * @When I wait :seconds seconds |
||
103 | */ |
||
104 | public function iWaitSeconds($seconds) |
||
108 | |||
109 | /** |
||
110 | * @Then I should not be able to retrieve it |
||
111 | */ |
||
112 | public function iShouldNotBeAbleToRetrieveIt() |
||
118 | |||
119 | /** |
||
120 | * @When I delete the item from the cache |
||
121 | */ |
||
122 | public function iDeleteTheItemFromTheCache() |
||
126 | |||
127 | /** |
||
128 | * @When I flush all the items item from the cache |
||
129 | */ |
||
130 | public function iFlushAllTheItemsItemFromTheCache() |
||
134 | |||
135 | /** |
||
136 | * @When I request a new redis cache instance to the factory |
||
137 | */ |
||
138 | public function iRequestANewRedisCacheInstanceToTheFactory() |
||
145 | |||
146 | /** |
||
147 | * @Given I have the connection parameters for redis |
||
148 | * @Then I should receive a redis cache already connected |
||
149 | */ |
||
150 | public function doNothing() |
||
154 | |||
155 | /** |
||
156 | * @Given The container is empty |
||
157 | */ |
||
158 | public function theContainerIsEmpty() |
||
162 | |||
163 | /** |
||
164 | * @When I pass the options to build the array access to the provider |
||
165 | */ |
||
166 | public function iPassTheOptionsToBuildTheArrayAccessToTheProvider() |
||
170 | |||
171 | /** |
||
172 | * @When I register the provider without any option |
||
173 | */ |
||
174 | public function iRegisterTheProviderWithoutAnyOption() |
||
178 | |||
179 | /** |
||
180 | * @When I pass the options to build the redis cache from parameters to the provider |
||
181 | */ |
||
182 | public function iPassTheOptionsToBuildTheRedisCacheFromParametersToTheProvider() |
||
191 | |||
192 | /** |
||
193 | * @When I pass the options to build the redis cache from an open connection to the provider |
||
194 | */ |
||
195 | public function iPassTheOptionsToBuildTheRedisCacheFromAnOpenConnectionToTheProvider() |
||
199 | |||
200 | /** |
||
201 | * @When I register the provider with the debug flag set to true |
||
202 | */ |
||
203 | public function iRegisterTheProviderWithTheDebugFlagSetToTrue() |
||
207 | |||
208 | /** |
||
209 | * @Then I should retrieve the test decorated cache |
||
210 | */ |
||
211 | public function iShouldRetrieveTheTestDecoratedCache() |
||
217 | |||
218 | /** |
||
219 | * @Then I should retrieve the redis cache object |
||
220 | */ |
||
221 | public function iShouldRetrieveTheRedisCacheObject() |
||
227 | |||
228 | /** |
||
229 | * @Then I should retrieve the array cache object |
||
230 | */ |
||
231 | public function iShouldRetrieveTheArrayCacheObject() |
||
237 | } |