Code Duplication    Length = 16-17 lines in 3 locations

tests/Date/DiffTest.php 3 locations

@@ 203-218 (lines=16) @@
200
        );
201
    }
202
203
    public function testDiffInDaysFilteredNegativeWithSignWithSecondObject()
204
    {
205
        $dt1 = Date::createFromDate(2000, 1, 31);
206
        $dt2 = Date::createFromDate(2000, 1, 1);
207
208
        $this->assertSame(
209
            -5,
210
            $dt1->diffInDaysFiltered(
211
                function (Date $date) {
212
                    return $date->getDayOfWeek() === Date::SUNDAY;
213
                },
214
                $dt2,
215
                false
216
            )
217
        );
218
    }
219
220
    public function testDiffInHoursFiltered()
221
    {
@@ 236-251 (lines=16) @@
233
        );
234
    }
235
236
    public function testDiffInHoursFilteredNegative()
237
    {
238
        $dt1 = Date::createFromDate(2000, 1, 31)->endOfDay();
239
        $dt2 = Date::createFromDate(2000, 1, 1)->startOfDay();
240
241
        $this->assertSame(
242
            -31,
243
            $dt1->diffInHoursFiltered(
244
                function (Date $date) {
245
                    return $date->getHour() === 9;
246
                },
247
                $dt2,
248
                false
249
            )
250
        );
251
    }
252
253
    public function testDiffInHoursFilteredWorkHoursPerWeek()
254
    {
@@ 350-366 (lines=17) @@
347
        );
348
    }
349
350
    public function testDiffFilteredNegativeWithSignWithSecondObject()
351
    {
352
        $dt1 = Date::createFromDate(2001, 1, 31);
353
        $dt2 = Date::createFromDate(1999, 1, 1);
354
355
        $this->assertSame(
356
            -12,
357
            $dt1->diffFiltered(
358
                Interval::month(),
359
                function (Date $date) {
360
                    return $date->getYear() === 2000;
361
                },
362
                $dt2,
363
                false
364
            )
365
        );
366
    }
367
368
    public function testBug188DiffWithSameDates()
369
    {