1 | <?php |
||
9 | class FeatureContext implements SnippetAcceptingContext |
||
10 | { |
||
11 | /** |
||
12 | * @var \Redis |
||
13 | */ |
||
14 | private $redis; |
||
15 | |||
16 | /** |
||
17 | * @var RedisCache |
||
18 | */ |
||
19 | private $backend; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $result; |
||
25 | |||
26 | /** |
||
27 | * FeatureContext constructor. |
||
28 | */ |
||
29 | public function __construct() |
||
35 | |||
36 | /** |
||
37 | * @BeforeScenario |
||
38 | */ |
||
39 | public function reset() |
||
43 | |||
44 | /** |
||
45 | * @Given I store a an item in the cache |
||
46 | */ |
||
47 | public function iStoreAAnItemInTheCache() |
||
51 | |||
52 | /** |
||
53 | * @When I retrieve it |
||
54 | */ |
||
55 | public function whenIRetrieved() |
||
59 | |||
60 | /** |
||
61 | * @Then I should get the same item |
||
62 | */ |
||
63 | public function iShouldGetTheSameItem() |
||
69 | |||
70 | /** |
||
71 | * @param $timeToLive |
||
72 | * |
||
73 | * @Given I store a an item in the cache for :timeToLive second |
||
74 | */ |
||
75 | public function iStoreAAnItemInTheCacheForSecond($timeToLive) |
||
79 | |||
80 | /** |
||
81 | * @param $seconds |
||
82 | * |
||
83 | * @When I wait :seconds seconds |
||
84 | */ |
||
85 | public function iWaitSeconds($seconds) |
||
89 | |||
90 | /** |
||
91 | * @Then I should not be able to retrieve it |
||
92 | */ |
||
93 | public function iShouldNotBeAbleToRetrieveIt() |
||
99 | |||
100 | /** |
||
101 | * @When I delete the item from the cache |
||
102 | */ |
||
103 | public function iDeleteTheItemFromTheCache() |
||
107 | |||
108 | /** |
||
109 | * @Given I store two items in the cache |
||
110 | */ |
||
111 | public function iStoreTwoItemsInTheCache() |
||
116 | |||
117 | /** |
||
118 | * @When I delete the two items from the cache |
||
119 | */ |
||
120 | public function iDeleteTheTwoItemsFromTheCache() |
||
124 | |||
125 | /** |
||
126 | * @Then I should not be able to retrieve any of them |
||
127 | */ |
||
128 | public function iShouldNotBeAbleToRetrieveAnyOfThem() |
||
136 | |||
137 | /** |
||
138 | * @When I flush all the items item from the cache |
||
139 | */ |
||
140 | public function iFlushAllTheItemsItemFromTheCache() |
||
144 | |||
145 | /** |
||
146 | * @When I request a new redis cache instance to the factory |
||
147 | */ |
||
148 | public function iRequestANewRedisCacheInstanceToTheFactory() |
||
158 | |||
159 | /** |
||
160 | * @Given I have the connection parameters for redis |
||
161 | * @Then I should receive a redis cache already connected |
||
162 | */ |
||
163 | public function doNothing() |
||
167 | } |
||
168 |