From f70fdbe5e97a5b705f7d517c9380babb33d0e870 Mon Sep 17 00:00:00 2001 From: Christian Kolb Date: Mon, 6 May 2024 08:28:05 +0200 Subject: [PATCH] Add tests --- tests/Clock/FrozenClockTest.php | 28 ++++++++++++++++++++++++++++ tests/Clock/SystemClockTest.php | 29 +++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 tests/Clock/FrozenClockTest.php create mode 100644 tests/Clock/SystemClockTest.php diff --git a/tests/Clock/FrozenClockTest.php b/tests/Clock/FrozenClockTest.php new file mode 100644 index 0000000..1def786 --- /dev/null +++ b/tests/Clock/FrozenClockTest.php @@ -0,0 +1,28 @@ +freeze($moment); + + // -- Assert + self::assertSame($moment, $clock->now()); + } +} diff --git a/tests/Clock/SystemClockTest.php b/tests/Clock/SystemClockTest.php new file mode 100644 index 0000000..e78f271 --- /dev/null +++ b/tests/Clock/SystemClockTest.php @@ -0,0 +1,29 @@ +now(); + + // -- Assert + self::assertEquals($moment->dateTime->getTimezone(), new \DateTimeZone('UTC')); + } +}