Code Duplication    Length = 14-14 lines in 5 locations

tests/Repository/EntitySpecificationRepositorySpec.php 5 locations

@@ 154-167 (lines=14) @@
151
        $this->matchSingleResult($specification)->shouldReturn($singleResult);
152
    }
153
154
    public function it_throws_exception_when_expecting_single_result_finding_none_without_result_modifier(
155
        Specification $specification,
156
        EntityManager $entityManager,
157
        QueryBuilder $qb,
158
        AbstractQuery $query
159
    ) {
160
        $this->prepareStubs($specification, $entityManager, $qb, $query);
161
162
        $specification->modify($qb, $this->alias)->shouldBeCalled();
163
164
        $query->getSingleResult()->willThrow(new DoctrineNoResultException());
165
166
        $this->shouldThrow(NoResultException::class)->duringMatchSingleResult($specification);
167
    }
168
169
    public function it_throws_exception_when_expecting_single_result_finding_multiple_without_result_modifier(
170
        Specification $specification,
@@ 169-182 (lines=14) @@
166
        $this->shouldThrow(NoResultException::class)->duringMatchSingleResult($specification);
167
    }
168
169
    public function it_throws_exception_when_expecting_single_result_finding_multiple_without_result_modifier(
170
        Specification $specification,
171
        EntityManager $entityManager,
172
        QueryBuilder $qb,
173
        AbstractQuery $query
174
    ) {
175
        $this->prepareStubs($specification, $entityManager, $qb, $query);
176
177
        $specification->modify($qb, $this->alias)->shouldBeCalled();
178
179
        $query->getSingleResult()->willThrow(new DoctrineNonUniqueResultException());
180
181
        $this->shouldThrow(NonUniqueResultException::class)->duringMatchSingleResult($specification);
182
    }
183
184
    public function it_matches_a_single_scalar_result_without_result_modifier(
185
        Specification $specification,
@@ 201-214 (lines=14) @@
198
        $this->matchSingleScalarResult($specification)->shouldReturn($singleScalarResult);
199
    }
200
201
    public function it_throws_exception_when_expecting_single_scalar_result_finding_multiple_without_result_modifier(
202
        Specification $specification,
203
        EntityManager $entityManager,
204
        QueryBuilder $qb,
205
        AbstractQuery $query
206
    ) {
207
        $this->prepareStubs($specification, $entityManager, $qb, $query);
208
209
        $specification->modify($qb, $this->alias)->shouldBeCalled();
210
211
        $query->getSingleScalarResult()->willThrow(new DoctrineNonUniqueResultException());
212
213
        $this->shouldThrow(NonUniqueResultException::class)->duringMatchSingleScalarResult($specification);
214
    }
215
216
    public function it_matches_a_scalar_result_when_expecting_one_or_null_without_result_modifier(
217
        Specification $specification,
@@ 250-263 (lines=14) @@
247
        $this->matchOneOrNullResult($specification)->shouldReturn($singleResult);
248
    }
249
250
    public function it_matches_null_when_expecting_one_or_null_without_result_modifier(
251
        Specification $specification,
252
        EntityManager $entityManager,
253
        QueryBuilder $qb,
254
        AbstractQuery $query
255
    ) {
256
        $this->prepareStubs($specification, $entityManager, $qb, $query);
257
258
        $specification->modify($qb, $this->alias)->shouldBeCalled();
259
260
        $query->getSingleResult()->willThrow(new DoctrineNonUniqueResultException());
261
262
        $this->shouldThrow(NonUniqueResultException::class)->duringMatchOneOrNullResult($specification);
263
    }
264
265
    public function it_throws_exception_when_expecting_one_or_null_finding_multiple_without_result_modifier(
266
        Specification $specification,
@@ 265-278 (lines=14) @@
262
        $this->shouldThrow(NonUniqueResultException::class)->duringMatchOneOrNullResult($specification);
263
    }
264
265
    public function it_throws_exception_when_expecting_one_or_null_finding_multiple_without_result_modifier(
266
        Specification $specification,
267
        EntityManager $entityManager,
268
        QueryBuilder $qb,
269
        AbstractQuery $query
270
    ) {
271
        $this->prepareStubs($specification, $entityManager, $qb, $query);
272
273
        $specification->modify($qb, $this->alias)->shouldBeCalled();
274
275
        $query->getSingleResult()->willThrow(new DoctrineNonUniqueResultException());
276
277
        $this->shouldThrow(UnexpectedResultException::class)->duringMatchOneOrNullResult($specification);
278
    }
279
280
    public function it_matches_a_specification_with_result_modifier(
281
        Specification $specification,