| @@ 143-157 (lines=15) @@ | ||
| 140 | $this->isSatisfiedBy($player)->shouldBe(true); |
|
| 141 | } |
|
| 142 | ||
| 143 | public function it_filter_array_collection_in_context(): void |
|
| 144 | { |
|
| 145 | $releaseAt = new \DateTimeImmutable(); |
|
| 146 | $tetris = ['name' => 'Tetris', 'releaseAt' => $releaseAt]; |
|
| 147 | $mahjong = ['name' => 'Mahjong', 'releaseAt' => null]; |
|
| 148 | $players = [ |
|
| 149 | ['pseudo' => 'Joe', 'gender' => 'M', 'points' => 2500, 'inGame' => $mahjong], |
|
| 150 | ['pseudo' => 'Moe', 'gender' => 'M', 'points' => 1230, 'inGame' => $mahjong], |
|
| 151 | ['pseudo' => 'Alice', 'gender' => 'F', 'points' => 9001, 'inGame' => $tetris], |
|
| 152 | ]; |
|
| 153 | ||
| 154 | $this->beConstructedWith('releaseAt', 'inGame'); |
|
| 155 | ||
| 156 | $this->filterCollection($players)->shouldYield([$players[2]]); |
|
| 157 | } |
|
| 158 | ||
| 159 | public function it_filter_array_collection_in_global_context(): void |
|
| 160 | { |
|
| @@ 159-173 (lines=15) @@ | ||
| 156 | $this->filterCollection($players)->shouldYield([$players[2]]); |
|
| 157 | } |
|
| 158 | ||
| 159 | public function it_filter_array_collection_in_global_context(): void |
|
| 160 | { |
|
| 161 | $releaseAt = new \DateTimeImmutable(); |
|
| 162 | $tetris = ['name' => 'Tetris', 'releaseAt' => $releaseAt]; |
|
| 163 | $mahjong = ['name' => 'Mahjong', 'releaseAt' => null]; |
|
| 164 | $players = [ |
|
| 165 | ['pseudo' => 'Joe', 'gender' => 'M', 'points' => 2500, 'inGame' => $mahjong], |
|
| 166 | ['pseudo' => 'Moe', 'gender' => 'M', 'points' => 1230, 'inGame' => $mahjong], |
|
| 167 | ['pseudo' => 'Alice', 'gender' => 'F', 'points' => 9001, 'inGame' => $tetris], |
|
| 168 | ]; |
|
| 169 | ||
| 170 | $this->beConstructedWith('releaseAt', null); |
|
| 171 | ||
| 172 | $this->filterCollection($players, 'inGame')->shouldYield([$players[2]]); |
|
| 173 | } |
|
| 174 | ||
| 175 | public function it_is_satisfied_in_global_context(): void |
|
| 176 | { |
|
| @@ 141-155 (lines=15) @@ | ||
| 138 | $this->isSatisfiedBy($player)->shouldBe(true); |
|
| 139 | } |
|
| 140 | ||
| 141 | public function it_filter_array_collection_in_context(): void |
|
| 142 | { |
|
| 143 | $releaseAt = new \DateTimeImmutable(); |
|
| 144 | $tetris = ['name' => 'Tetris', 'releaseAt' => null]; |
|
| 145 | $mahjong = ['name' => 'Mahjong', 'releaseAt' => $releaseAt]; |
|
| 146 | $players = [ |
|
| 147 | ['pseudo' => 'Joe', 'gender' => 'M', 'points' => 2500, 'inGame' => $mahjong], |
|
| 148 | ['pseudo' => 'Moe', 'gender' => 'M', 'points' => 1230, 'inGame' => $mahjong], |
|
| 149 | ['pseudo' => 'Alice', 'gender' => 'F', 'points' => 9001, 'inGame' => $tetris], |
|
| 150 | ]; |
|
| 151 | ||
| 152 | $this->beConstructedWith('releaseAt', 'inGame'); |
|
| 153 | ||
| 154 | $this->filterCollection($players)->shouldYield([$players[2]]); |
|
| 155 | } |
|
| 156 | ||
| 157 | public function it_filter_array_collection_in_global_context(): void |
|
| 158 | { |
|
| @@ 157-171 (lines=15) @@ | ||
| 154 | $this->filterCollection($players)->shouldYield([$players[2]]); |
|
| 155 | } |
|
| 156 | ||
| 157 | public function it_filter_array_collection_in_global_context(): void |
|
| 158 | { |
|
| 159 | $releaseAt = new \DateTimeImmutable(); |
|
| 160 | $tetris = ['name' => 'Tetris', 'releaseAt' => null]; |
|
| 161 | $mahjong = ['name' => 'Mahjong', 'releaseAt' => $releaseAt]; |
|
| 162 | $players = [ |
|
| 163 | ['pseudo' => 'Joe', 'gender' => 'M', 'points' => 2500, 'inGame' => $mahjong], |
|
| 164 | ['pseudo' => 'Moe', 'gender' => 'M', 'points' => 1230, 'inGame' => $mahjong], |
|
| 165 | ['pseudo' => 'Alice', 'gender' => 'F', 'points' => 9001, 'inGame' => $tetris], |
|
| 166 | ]; |
|
| 167 | ||
| 168 | $this->beConstructedWith('releaseAt', null); |
|
| 169 | ||
| 170 | $this->filterCollection($players, 'inGame')->shouldYield([$players[2]]); |
|
| 171 | } |
|
| 172 | ||
| 173 | public function it_is_satisfied_in_global_context(): void |
|
| 174 | { |
|
| @@ 311-325 (lines=15) @@ | ||
| 308 | $this->filterCollection($players)->shouldYield([$players[2]]); |
|
| 309 | } |
|
| 310 | ||
| 311 | public function it_filter_array_collection_in_global_context(): void |
|
| 312 | { |
|
| 313 | $releaseAt = new \DateTimeImmutable(); |
|
| 314 | $tetris = ['name' => 'Tetris', 'releaseAt' => null]; |
|
| 315 | $mahjong = ['name' => 'Mahjong', 'releaseAt' => $releaseAt]; |
|
| 316 | $players = [ |
|
| 317 | ['pseudo' => 'Joe', 'gender' => 'M', 'points' => 2500, 'inGame' => $mahjong], |
|
| 318 | ['pseudo' => 'Moe', 'gender' => 'M', 'points' => 1230, 'inGame' => $mahjong], |
|
| 319 | ['pseudo' => 'Alice', 'gender' => 'F', 'points' => 9001, 'inGame' => $tetris], |
|
| 320 | ]; |
|
| 321 | ||
| 322 | $this->beConstructedWith('name', 'tr', Like::CONTAINS, null); |
|
| 323 | ||
| 324 | $this->filterCollection($players, 'inGame')->shouldYield([$players[2]]); |
|
| 325 | } |
|
| 326 | ||
| 327 | public function it_is_satisfied_in_global_context(): void |
|
| 328 | { |
|
| @@ 135-149 (lines=15) @@ | ||
| 132 | $this->isSatisfiedBy($player)->shouldBe(true); |
|
| 133 | } |
|
| 134 | ||
| 135 | public function it_filter_array_collection_in_context(): void |
|
| 136 | { |
|
| 137 | $releaseAt = new \DateTimeImmutable(); |
|
| 138 | $tetris = ['name' => 'Tetris', 'releaseAt' => null]; |
|
| 139 | $mahjong = ['name' => 'Mahjong', 'releaseAt' => $releaseAt]; |
|
| 140 | $players = [ |
|
| 141 | ['pseudo' => 'Joe', 'gender' => 'M', 'points' => 2500, 'inGame' => $mahjong], |
|
| 142 | ['pseudo' => 'Moe', 'gender' => 'M', 'points' => 1230, 'inGame' => $mahjong], |
|
| 143 | ['pseudo' => 'Alice', 'gender' => 'F', 'points' => 9001, 'inGame' => $tetris], |
|
| 144 | ]; |
|
| 145 | ||
| 146 | $this->beConstructedWith('releaseAt', 'inGame'); |
|
| 147 | ||
| 148 | $this->filterCollection($players)->shouldYield([$players[2]]); |
|
| 149 | } |
|
| 150 | ||
| 151 | public function it_filter_array_collection_in_global_context(): void |
|
| 152 | { |
|
| @@ 151-165 (lines=15) @@ | ||
| 148 | $this->filterCollection($players)->shouldYield([$players[2]]); |
|
| 149 | } |
|
| 150 | ||
| 151 | public function it_filter_array_collection_in_global_context(): void |
|
| 152 | { |
|
| 153 | $releaseAt = new \DateTimeImmutable(); |
|
| 154 | $tetris = ['name' => 'Tetris', 'releaseAt' => null]; |
|
| 155 | $mahjong = ['name' => 'Mahjong', 'releaseAt' => $releaseAt]; |
|
| 156 | $players = [ |
|
| 157 | ['pseudo' => 'Joe', 'gender' => 'M', 'points' => 2500, 'inGame' => $mahjong], |
|
| 158 | ['pseudo' => 'Moe', 'gender' => 'M', 'points' => 1230, 'inGame' => $mahjong], |
|
| 159 | ['pseudo' => 'Alice', 'gender' => 'F', 'points' => 9001, 'inGame' => $tetris], |
|
| 160 | ]; |
|
| 161 | ||
| 162 | $this->beConstructedWith('releaseAt', null); |
|
| 163 | ||
| 164 | $this->filterCollection($players, 'inGame')->shouldYield([$players[2]]); |
|
| 165 | } |
|
| 166 | ||
| 167 | public function it_is_satisfied_in_global_context(): void |
|
| 168 | { |
|