@@ 68-79 (lines=12) @@ | ||
65 | $this->filterCollection($players)->shouldYield([]); |
|
66 | } |
|
67 | ||
68 | public function it_filter_object_collection(): void |
|
69 | { |
|
70 | $this->beConstructedWith(Player::class, null); |
|
71 | ||
72 | $players = [ |
|
73 | new Player('Joe', 'M', 2500), |
|
74 | new Player('Moe', 'M', 1230), |
|
75 | new Player('Alice', 'F', 9001), |
|
76 | ]; |
|
77 | ||
78 | $this->filterCollection($players)->shouldYield([$players[0], $players[1], $players[2]]); |
|
79 | } |
|
80 | ||
81 | public function it_is_satisfied_with_array(): void |
|
82 | { |
@@ 79-90 (lines=12) @@ | ||
76 | $this->filterCollection($players)->shouldYield([$players[0], $players[2]]); |
|
77 | } |
|
78 | ||
79 | public function it_filter_object_collection(): void |
|
80 | { |
|
81 | $this->beConstructedWith('points', null); |
|
82 | ||
83 | $players = [ |
|
84 | new Player('Joe', 'M', 2500), |
|
85 | new Player('Moe', 'M', null), |
|
86 | new Player('Alice', 'F', 9001), |
|
87 | ]; |
|
88 | ||
89 | $this->filterCollection($players)->shouldYield([$players[0], $players[2]]); |
|
90 | } |
|
91 | ||
92 | public function it_is_satisfied_with_array(): void |
|
93 | { |
@@ 78-89 (lines=12) @@ | ||
75 | $this->filterCollection($players)->shouldYield([$players[0], $players[1]]); |
|
76 | } |
|
77 | ||
78 | public function it_filter_object_collection(): void |
|
79 | { |
|
80 | $this->beConstructedWith('points', 2500, null); |
|
81 | ||
82 | $players = [ |
|
83 | new Player('Joe', 'M', 2500), |
|
84 | new Player('Moe', 'M', 1230), |
|
85 | new Player('Alice', 'F', 9001), |
|
86 | ]; |
|
87 | ||
88 | $this->filterCollection($players)->shouldYield([$players[0], $players[1]]); |
|
89 | } |
|
90 | ||
91 | public function it_is_satisfied_with_array(): void |
|
92 | { |
@@ 130-141 (lines=12) @@ | ||
127 | $this->filterCollection($players)->shouldYield([$players[1]]); |
|
128 | } |
|
129 | ||
130 | public function it_filter_object_collection_ends_with(): void |
|
131 | { |
|
132 | $this->beConstructedWith('pseudo', 'oe', Like::ENDS_WITH, null); |
|
133 | ||
134 | $players = [ |
|
135 | new Player('Joe', 'M', 2500), |
|
136 | new Player('Moe', 'M', 1230), |
|
137 | new Player('Alice', 'F', 9001), |
|
138 | ]; |
|
139 | ||
140 | $this->filterCollection($players)->shouldYield([$players[0], $players[1]]); |
|
141 | } |
|
142 | ||
143 | public function it_filter_object_collection_contains(): void |
|
144 | { |
|
@@ 143-154 (lines=12) @@ | ||
140 | $this->filterCollection($players)->shouldYield([$players[0], $players[1]]); |
|
141 | } |
|
142 | ||
143 | public function it_filter_object_collection_contains(): void |
|
144 | { |
|
145 | $this->beConstructedWith('pseudo', 'o', Like::CONTAINS, null); |
|
146 | ||
147 | $players = [ |
|
148 | new Player('Joe', 'M', 2500), |
|
149 | new Player('Moe', 'M', 1230), |
|
150 | new Player('Alice', 'F', 9001), |
|
151 | ]; |
|
152 | ||
153 | $this->filterCollection($players)->shouldYield([$players[0], $players[1]]); |
|
154 | } |
|
155 | ||
156 | public function it_is_satisfied_with_array_starts_with(): void |
|
157 | { |