File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 4
4
/CONTRIBUTING.md export-ignore
5
5
/phpcs.xml.dist export-ignore
6
6
/phpstan.neon export-ignore
7
- /benchmark export-ignore
7
+ /performance export-ignore
8
8
/generator export-ignore
Original file line number Diff line number Diff line change @@ -142,4 +142,15 @@ public function testSerialize()
142
142
$ this ->assertEquals ($ safeDatetime ->getTimestamp (), $ newDatetime ->getTimestamp ());
143
143
$ this ->assertEquals ($ safeDatetime ->getTimezone (), $ newDatetime ->getTimezone ());
144
144
}
145
+
146
+ public function testComparaison (): void
147
+ {
148
+ $ safeDateTime = new \Safe \DateTimeImmutable ();
149
+ $ phpDateTime = new \DateTimeImmutable ();
150
+ $ timeLimit = \DateInterval::createFromDateString ('2 hours ' );
151
+
152
+ $ a = $ safeDateTime ->modify ('+3 hours ' ) < $ safeDateTime ->add ($ timeLimit );
153
+ $ b = $ phpDateTime ->modify ('+3 hours ' ) < $ phpDateTime ->add ($ timeLimit );
154
+ $ this ->assertEquals ($ b , $ a );
155
+ }
145
156
}
You can’t perform that action at this time.
0 commit comments