assertEquals([ 'referer' => 'some site', 'date' => ($date ?? $visit->getDate())->toAtomString(), 'userAgent' => 'Chrome', 'visitLocation' => null, ], $visit->jsonSerialize()); } public function provideDates(): iterable { yield 'null date' => [null]; yield 'not null date' => [Chronos::now()->subDays(10)]; } }