@@ -84,7 +84,7 @@ |
||
| 84 | 84 | foreach (array_unique($tagNames) as $tagName) { |
| 85 | 85 | if(is_string($tagName)){ |
| 86 | 86 | $items = array_merge($items, $this->getItemsByTag($tagName)); |
| 87 | - }else{ |
|
| 87 | + } else{ |
|
| 88 | 88 | throw new InvalidArgumentException('$tagName must be a a string'); |
| 89 | 89 | } |
| 90 | 90 | } |
@@ -82,15 +82,13 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | echo "[PASS] STEP#1 // Successfully retrieved 3 tagged item keys\n"; |
| 85 | - } |
|
| 86 | - else |
|
| 85 | + } else |
|
| 87 | 86 | { |
| 88 | 87 | echo '[FAIL] STEP#1 //Got wrong count of item:' . count($tagsItems) . "\n"; |
| 89 | 88 | $status = 1; |
| 90 | 89 | goto itemTagTest2; |
| 91 | 90 | } |
| 92 | -} |
|
| 93 | -else |
|
| 91 | +} else |
|
| 94 | 92 | { |
| 95 | 93 | echo '[FAIL] STEP#1 // Expected $tagsItems to be an array, got: ' . gettype($tagsItems) . "\n"; |
| 96 | 94 | $status = 1; |
@@ -120,15 +118,13 @@ discard block |
||
| 120 | 118 | } |
| 121 | 119 | } |
| 122 | 120 | echo "[PASS] STEP#2 // Successfully retrieved 3 tagged item key\n"; |
| 123 | - } |
|
| 124 | - else |
|
| 121 | + } else |
|
| 125 | 122 | { |
| 126 | 123 | echo '[FAIL] STEP#2 // Got wrong count of item:' . count($tagsItems) . "\n"; |
| 127 | 124 | $status = 1; |
| 128 | 125 | goto itemTagTest3; |
| 129 | 126 | } |
| 130 | -} |
|
| 131 | -else |
|
| 127 | +} else |
|
| 132 | 128 | { |
| 133 | 129 | echo '[FAIL] STEP#2 // Expected $tagsItems to be an array, got: ' . gettype($tagsItems) . "\n"; |
| 134 | 130 | $status = 1; |
@@ -157,22 +153,19 @@ discard block |
||
| 157 | 153 | goto itemTagTest4; |
| 158 | 154 | } |
| 159 | 155 | echo "[PASS] STEP#3 // Successfully retrieved 1 tagged item keys\n"; |
| 160 | - } |
|
| 161 | - else |
|
| 156 | + } else |
|
| 162 | 157 | { |
| 163 | 158 | echo '[FAIL] STEP#3 // Got wrong array key, expected "tag-test3", got "' . key($tagsItems) . "\"\n"; |
| 164 | 159 | $status = 1; |
| 165 | 160 | goto itemTagTest4; |
| 166 | 161 | } |
| 167 | - } |
|
| 168 | - else |
|
| 162 | + } else |
|
| 169 | 163 | { |
| 170 | 164 | echo '[FAIL] STEP#3 // Got wrong count of item:' . count($tagsItems) . "\n"; |
| 171 | 165 | $status = 1; |
| 172 | 166 | goto itemTagTest4; |
| 173 | 167 | } |
| 174 | -} |
|
| 175 | -else |
|
| 168 | +} else |
|
| 176 | 169 | { |
| 177 | 170 | echo '[FAIL] STEP#3 // Expected $tagsItems to be an array, got: ' . gettype($tagsItems) . "\n"; |
| 178 | 171 | $status = 1; |
@@ -192,8 +185,7 @@ discard block |
||
| 192 | 185 | { |
| 193 | 186 | echo "[FAIL] STEP#4 // Getter getItemsByTag() found item(s), possible memory leak \n"; |
| 194 | 187 | $status = 1; |
| 195 | -} |
|
| 196 | -else |
|
| 188 | +} else |
|
| 197 | 189 | { |
| 198 | 190 | echo "[PASS] STEP#4 // Getter getItemsByTag() found no item \n"; |
| 199 | 191 | } |
@@ -205,8 +197,7 @@ discard block |
||
| 205 | 197 | { |
| 206 | 198 | echo "[FAIL] STEP#4 // Item 'tag-test{$i}' should've been deleted and is still in cache storage \n"; |
| 207 | 199 | $status = 1; |
| 208 | - } |
|
| 209 | - else |
|
| 200 | + } else |
|
| 210 | 201 | { |
| 211 | 202 | echo "[PASS] STEP#4 // Item 'tag-test{$i}' have been deleted and is no longer in cache storage \n"; |
| 212 | 203 | } |
@@ -226,8 +217,7 @@ discard block |
||
| 226 | 217 | { |
| 227 | 218 | echo "[FAIL] STEP#5 // Getter getItemsByTag() found item(s), possible memory leak \n"; |
| 228 | 219 | $status = 1; |
| 229 | -} |
|
| 230 | -else |
|
| 220 | +} else |
|
| 231 | 221 | { |
| 232 | 222 | echo "[PASS] STEP#5 // Getter getItemsByTag() found no item \n"; |
| 233 | 223 | } |
@@ -239,8 +229,7 @@ discard block |
||
| 239 | 229 | { |
| 240 | 230 | echo "[FAIL] STEP#5 // Item 'tag-test{$i}' should've been deleted and is still in cache storage \n"; |
| 241 | 231 | $status = 1; |
| 242 | - } |
|
| 243 | - else |
|
| 232 | + } else |
|
| 244 | 233 | { |
| 245 | 234 | echo "[PASS] STEP#5 // Item 'tag-test{$i}' have been deleted and is no longer in cache storage \n"; |
| 246 | 235 | } |
@@ -263,8 +252,7 @@ discard block |
||
| 263 | 252 | { |
| 264 | 253 | echo "[FAIL] STEP#6 // Getter getItem() found item 'item-test_3', possible memory leak \n"; |
| 265 | 254 | $status = 1; |
| 266 | -} |
|
| 267 | -else |
|
| 255 | +} else |
|
| 268 | 256 | { |
| 269 | 257 | echo "[PASS] STEP#6 // Getter getItem() did not found item 'item-test_3' \n"; |
| 270 | 258 | } |
@@ -285,8 +273,7 @@ discard block |
||
| 285 | 273 | { |
| 286 | 274 | echo "[FAIL] STEP#7 // Item '{$item->getKey()}' does not have the string part '{$appendStr}' in it's value \n"; |
| 287 | 275 | $status = 1; |
| 288 | - } |
|
| 289 | - else |
|
| 276 | + } else |
|
| 290 | 277 | { |
| 291 | 278 | echo "[PASS] STEP#7 // Item 'tag-test{$item->getKey()}' does have the string part '{$appendStr}' in it's value \n"; |
| 292 | 279 | } |
@@ -308,8 +295,7 @@ discard block |
||
| 308 | 295 | { |
| 309 | 296 | echo "[FAIL] STEP#7 // Item '{$item->getKey()}' does not have the string part '{$prependStr}' in it's value \n"; |
| 310 | 297 | $status = 1; |
| 311 | - } |
|
| 312 | - else |
|
| 298 | + } else |
|
| 313 | 299 | { |
| 314 | 300 | echo "[PASS] STEP#7 // Item 'tag-test{$item->getKey()}' does have the string part '{$prependStr}' in it's value \n"; |
| 315 | 301 | } |