/** * @dataProvider data_dayOfWeekInMonth_negative */ public function test_dayOfWeekInMonth_negative($year, $month, DayOfWeek $dow, LocalDate $expected) { for ($ordinal = 0; $ordinal < 5; $ordinal++) { for ($day = 1; $day <= Month::of($month)->length(false); $day++) { $date = LocalDate::of($year, $month, $day); $test = TemporalAdjusters::dayOfWeekInMonth(-1 - $ordinal, $dow)->adjustInto($date); $this->assertEquals($test, $expected->minusWeeks($ordinal)); } } }