| @@ 93-133 (lines=41) @@ | ||
| 90 | /** |
|
| 91 | * Test remove. |
|
| 92 | */ |
|
| 93 | public function testRemove() |
|
| 94 | { |
|
| 95 | $this |
|
| 96 | ->given( |
|
| 97 | $unique = $this->uniqueValue(), |
|
| 98 | $emptyCollection = $this->emptyCollection() |
|
| 99 | ) |
|
| 100 | ->when($emptyCollection->add($unique)) |
|
| 101 | ->then() |
|
| 102 | ->list($emptyCollection) |
|
| 103 | ->contains($unique) |
|
| 104 | ->and() |
|
| 105 | ->when($result = $emptyCollection->remove($unique)) |
|
| 106 | ->then() |
|
| 107 | ->list($emptyCollection) |
|
| 108 | ->notContains($unique) |
|
| 109 | ->boolean($result) |
|
| 110 | ->isTrue() |
|
| 111 | ; |
|
| 112 | ||
| 113 | $this |
|
| 114 | ->given( |
|
| 115 | $unique = $this->uniqueValue(), |
|
| 116 | $randomCollection = $this->randomCollection() |
|
| 117 | ) |
|
| 118 | ->when($randomCollection->add($unique)) |
|
| 119 | ->then() |
|
| 120 | ->list($randomCollection) |
|
| 121 | ->contains($unique) |
|
| 122 | ->and() |
|
| 123 | ->when($randomCollection->remove($unique)) |
|
| 124 | ->then() |
|
| 125 | ->list($randomCollection) |
|
| 126 | ->notContains($unique) |
|
| 127 | ->and() |
|
| 128 | ->when($result = $randomCollection->remove('foo')) |
|
| 129 | ->then() |
|
| 130 | ->boolean($result) |
|
| 131 | ->isFalse() |
|
| 132 | ; |
|
| 133 | } |
|
| 134 | ||
| 135 | /* |
|
| 136 | * Test removeAll. |
|
| @@ 111-151 (lines=41) @@ | ||
| 108 | /** |
|
| 109 | * Test remove. |
|
| 110 | */ |
|
| 111 | public function testRemove() |
|
| 112 | { |
|
| 113 | $this |
|
| 114 | ->given( |
|
| 115 | $unique = $this->uniqueValue(), |
|
| 116 | $emptyCollection = $this->emptyCollection() |
|
| 117 | ) |
|
| 118 | ->when($emptyCollection->add($unique)) |
|
| 119 | ->then() |
|
| 120 | ->set($emptyCollection) |
|
| 121 | ->contains($unique) |
|
| 122 | ->and() |
|
| 123 | ->when($result = $emptyCollection->remove($unique)) |
|
| 124 | ->then() |
|
| 125 | ->set($emptyCollection) |
|
| 126 | ->notContains($unique) |
|
| 127 | ->boolean($result) |
|
| 128 | ->isTrue() |
|
| 129 | ; |
|
| 130 | ||
| 131 | $this |
|
| 132 | ->given( |
|
| 133 | $unique = $this->uniqueValue(), |
|
| 134 | $randomCollection = $this->randomCollection() |
|
| 135 | ) |
|
| 136 | ->when($randomCollection->add($unique)) |
|
| 137 | ->then() |
|
| 138 | ->set($randomCollection) |
|
| 139 | ->contains($unique) |
|
| 140 | ->and() |
|
| 141 | ->when($randomCollection->remove($unique)) |
|
| 142 | ->then() |
|
| 143 | ->set($randomCollection) |
|
| 144 | ->notContains($unique) |
|
| 145 | ->and() |
|
| 146 | ->when($result = $randomCollection->remove('foo')) |
|
| 147 | ->then() |
|
| 148 | ->boolean($result) |
|
| 149 | ->isFalse() |
|
| 150 | ; |
|
| 151 | } |
|
| 152 | ||
| 153 | /* |
|
| 154 | * Test removeAll. |
|