1 | <?php |
||
7 | class FeatureContext implements SnippetAcceptingContext |
||
8 | { |
||
9 | /** |
||
10 | * @var \Redis |
||
11 | */ |
||
12 | private $redis; |
||
13 | |||
14 | /** |
||
15 | * @var RedisCache |
||
16 | */ |
||
17 | private $backend; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $result; |
||
23 | |||
24 | /** |
||
25 | * FeatureContext constructor. |
||
26 | */ |
||
27 | public function __construct() |
||
33 | |||
34 | /** |
||
35 | * @BeforeScenario |
||
36 | */ |
||
37 | public function reset() |
||
41 | |||
42 | /** |
||
43 | * @Given The cache is empty |
||
44 | */ |
||
45 | public function theCacheIsEmpty() |
||
49 | |||
50 | /** |
||
51 | * @Given I store a an item in the cache |
||
52 | */ |
||
53 | public function iStoreAAnItemInTheCache() |
||
57 | |||
58 | /** |
||
59 | * @When I retrieve it |
||
60 | */ |
||
61 | public function whenIRetrieved() |
||
65 | |||
66 | /** |
||
67 | * @Then I should get the same item |
||
68 | */ |
||
69 | public function iShouldGetTheSameItem() |
||
75 | |||
76 | /** |
||
77 | * @param $timeToLive |
||
78 | * |
||
79 | * @Given I store a an item in the cache for :timeToLive second |
||
80 | */ |
||
81 | public function iStoreAAnItemInTheCacheForSecond($timeToLive) |
||
85 | |||
86 | /** |
||
87 | * @param $seconds |
||
88 | * |
||
89 | * @When I wait :seconds seconds |
||
90 | */ |
||
91 | public function iWaitSeconds($seconds) |
||
95 | |||
96 | /** |
||
97 | * @Then I should not be able to retrieve it |
||
98 | */ |
||
99 | public function iShouldNotBeAbleToRetrieveIt() |
||
105 | |||
106 | /** |
||
107 | * @When I delete the item from the cache |
||
108 | */ |
||
109 | public function iDeleteTheItemFromTheCache() |
||
113 | |||
114 | /** |
||
115 | * @When I flush all the items item from the cache |
||
116 | */ |
||
117 | public function iFlushAllTheItemsItemFromTheCache() |
||
121 | |||
122 | /** |
||
123 | * @When I request a new redis cache instance to the factory |
||
124 | */ |
||
125 | public function iRequestANewRedisCacheInstanceToTheFactory() |
||
132 | |||
133 | /** |
||
134 | * @Given I have the connection parameters for redis |
||
135 | * @Then I should receive a redis cache already connected |
||
136 | */ |
||
137 | public function doNothing() |
||
141 | } |