You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/CachePoolTest.php
+23-6
Original file line number
Diff line number
Diff line change
@@ -153,19 +153,23 @@ public function testGetItems()
153
153
154
154
$keys = ['foo', 'bar', 'baz'];
155
155
$items = $this->cache->getItems($keys);
156
-
$this->assertCount(3, $items);
156
+
157
+
$count = 0;
157
158
158
159
/** @type CacheItemInterface $item */
159
160
foreach ($itemsas$i => $item) {
160
161
$item->set($i);
161
162
$this->cache->save($item);
163
+
164
+
$count++;
162
165
}
163
166
167
+
$this->assertSame(3, $count);
168
+
164
169
$keys[] = 'biz';
165
170
/** @type CacheItemInterface[] $items */
166
-
$items = $this->cache->getItems($keys);
167
-
$this->assertCount(4, $items);
168
-
171
+
$items = $this->cache->getItems($keys);
172
+
$count = 0;
169
173
foreach ($itemsas$key => $item) {
170
174
$itemKey = $item->getKey();
171
175
$this->assertEquals($itemKey, $key, 'Keys must be preserved when fetching multiple items');
@@ -178,7 +182,11 @@ public function testGetItems()
178
182
unset($keys[$k]);
179
183
}
180
184
}
185
+
186
+
$count++;
181
187
}
188
+
189
+
$this->assertSame(4, $count);
182
190
}
183
191
184
192
publicfunctiontestGetItemsEmpty()
@@ -190,8 +198,17 @@ public function testGetItemsEmpty()
190
198
}
191
199
192
200
$items = $this->cache->getItems([]);
193
-
$this->assertCount(0, $items);
194
-
$this->assertTrue(is_array($items) || $itemsinstanceof \Traversable, 'A call to getItems with an empty array must always return an array or \Traversable.');
0 commit comments