|
18 | 18 | $value = str_shuffle(uniqid('pfc', true)); |
19 | 19 |
|
20 | 20 | if(!$Psr16Adapter->has('test-key')){ |
21 | | - $testHelper->printPassText('1/7 Psr16 hasser returned expected boolean (false)'); |
| 21 | + $testHelper->printPassText('1/9 Psr16 hasser returned expected boolean (false)'); |
22 | 22 | }else{ |
23 | | - $testHelper->printFailText('1/7 Psr16 hasser returned unexpected boolean (true)'); |
| 23 | + $testHelper->printFailText('1/9 Psr16 hasser returned unexpected boolean (true)'); |
24 | 24 | } |
25 | 25 |
|
26 | 26 | $testHelper->printNewLine()->printText('Setting up value to "test-key"...')->printNewLine(); |
27 | 27 | $Psr16Adapter->set('test-key', $value); |
28 | 28 |
|
29 | 29 | if($Psr16Adapter->get('test-key') === $value){ |
30 | | - $testHelper->printPassText('2/7 Psr16 getter returned expected value: ' . $value); |
| 30 | + $testHelper->printPassText('2/9 Psr16 getter returned expected value: ' . $value); |
31 | 31 | }else{ |
32 | | - $testHelper->printFailText('2/7 Psr16 getter returned unexpected value: ' . $value); |
| 32 | + $testHelper->printFailText('2/9 Psr16 getter returned unexpected value: ' . $value); |
33 | 33 | } |
34 | 34 |
|
35 | 35 | $testHelper->printNewLine()->printText('Deleting key "test-key"...')->printNewLine(); |
36 | 36 | $Psr16Adapter->delete('test-key'); |
37 | 37 |
|
38 | 38 | if(!$Psr16Adapter->has('test-key')){ |
39 | | - $testHelper->printPassText('3/7 Psr16 hasser returned expected boolean (false)'); |
| 39 | + $testHelper->printPassText('3/9 Psr16 hasser returned expected boolean (false)'); |
40 | 40 | }else{ |
41 | | - $testHelper->printFailText('3/7 Psr16 hasser returned unexpected boolean (true)'); |
| 41 | + $testHelper->printFailText('3/9 Psr16 hasser returned unexpected boolean (true)'); |
42 | 42 | } |
43 | 43 |
|
44 | 44 | $testHelper->printNewLine()->printText('Setting up value to "test-key, test-key2, test-key3"...')->printNewLine(); |
|
51 | 51 |
|
52 | 52 | $values = $Psr16Adapter->getMultiple(['test-key', 'test-key2', 'test-key3']); |
53 | 53 | if(count(array_filter($values)) === 3){ |
54 | | - $testHelper->printPassText('4/7 Psr16 multiple getters returned expected values (3)'); |
| 54 | + $testHelper->printPassText('4/9 Psr16 multiple getters returned expected values (3)'); |
55 | 55 | }else{ |
56 | | - $testHelper->printFailText('4/7 Psr16 getters(3) returned unexpected values.'); |
| 56 | + $testHelper->printFailText('4/9 Psr16 getters(3) returned unexpected values.'); |
| 57 | +} |
| 58 | + |
| 59 | +$values = $Psr16Adapter->getMultiple(new ArrayObject(['test-key', 'test-key2', 'test-key3'])); |
| 60 | +if(count(array_filter($values)) === 3){ |
| 61 | + $testHelper->printPassText('5/9 Psr16 multiple getters with Traversable returned expected values (3)'); |
| 62 | +}else{ |
| 63 | + $testHelper->printFailText('5/9 Psr16 getters(3) with Traversable returned unexpected values.'); |
57 | 64 | } |
58 | 65 |
|
59 | 66 | $testHelper->printNewLine()->printText('Clearing whole cache ...')->printNewLine(); |
|
67 | 74 | ]); |
68 | 75 |
|
69 | 76 | if($Psr16Adapter->has('test-key') && $Psr16Adapter->has('test-key2') && $Psr16Adapter->has('test-key3')){ |
70 | | - $testHelper->printPassText('5/7 Psr16 hasser returned expected booleans (true)'); |
| 77 | + $testHelper->printPassText('6/9 Psr16 hasser returned expected booleans (true)'); |
| 78 | +}else{ |
| 79 | + $testHelper->printFailText('6/9 Psr16 hasser returned one or more unexpected boolean (false)'); |
| 80 | +} |
| 81 | + |
| 82 | +$testHelper->printNewLine()->printText('Clearing whole cache ...')->printNewLine(); |
| 83 | +$Psr16Adapter->clear(); |
| 84 | + |
| 85 | +$testHelper->printText('Setting multiple values using a Traversable to "test-key, test-key2, test-key3"...')->printNewLine(); |
| 86 | +$Psr16Adapter->setMultiple(new ArrayObject([ |
| 87 | + 'test-key' => $value, |
| 88 | + 'test-key2' => $value, |
| 89 | + 'test-key3' => $value |
| 90 | +])); |
| 91 | + |
| 92 | +if($Psr16Adapter->has('test-key') && $Psr16Adapter->has('test-key2') && $Psr16Adapter->has('test-key3')){ |
| 93 | + $testHelper->printPassText('7/9 Psr16 hasser returned expected booleans (true)'); |
71 | 94 | }else{ |
72 | | - $testHelper->printFailText('5/7 Psr16 hasser returned one or more unexpected boolean (false)'); |
| 95 | + $testHelper->printFailText('7/9 Psr16 hasser returned one or more unexpected boolean (false)'); |
73 | 96 | } |
74 | 97 |
|
75 | 98 | $testHelper->printNewLine()->printText('Deleting up keys "test-key, test-key2, test-key3"...')->printNewLine(); |
76 | 99 | $Psr16Adapter->deleteMultiple(['test-key', 'test-key2', 'test-key3']); |
77 | 100 |
|
78 | 101 | if(!$Psr16Adapter->has('test-key') && !$Psr16Adapter->has('test-key2') && !$Psr16Adapter->has('test-key3')){ |
79 | | - $testHelper->printPassText('6/7 Psr16 hasser returned expected booleans (false)'); |
| 102 | + $testHelper->printPassText('8/9 Psr16 hasser returned expected booleans (false)'); |
80 | 103 | }else{ |
81 | | - $testHelper->printFailText('6/7 Psr16 hasser returned one or more unexpected boolean (true)'); |
| 104 | + $testHelper->printFailText('8/9 Psr16 hasser returned one or more unexpected boolean (true)'); |
82 | 105 | } |
83 | 106 |
|
84 | 107 | $testHelper->printNewLine()->printText('Clearing whole cache ...')->printNewLine(); |
|
95 | 118 | $Psr16Adapter->deleteMultiple($traversable); |
96 | 119 |
|
97 | 120 | if(!$Psr16Adapter->has('test-key') && !$Psr16Adapter->has('test-key2') && !$Psr16Adapter->has('test-key3')){ |
98 | | - $testHelper->printPassText('7/7 Psr16 hasser returned expected booleans (false)'); |
| 121 | + $testHelper->printPassText('9/9 Psr16 hasser returned expected booleans (false)'); |
99 | 122 | }else{ |
100 | | - $testHelper->printFailText('7/7 Psr16 hasser returned one or more unexpected boolean (true)'); |
| 123 | + $testHelper->printFailText('9/9 Psr16 hasser returned one or more unexpected boolean (true)'); |
101 | 124 | } |
102 | 125 |
|
103 | 126 | $testHelper->terminateTest(); |
0 commit comments