We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d8eadeb commit 7e505abCopy full SHA for 7e505ab
tests/Utils/DateTime.modifyClone.phpt
@@ -0,0 +1,25 @@
1
+<?php
2
+
3
+/**
4
+ * Test: Nette\DateTime::modifyClone().
5
+ */
6
7
+use Tester\Assert;
8
+use Nette\Utils\DateTime;
9
10
+require __DIR__ . '/../bootstrap.php';
11
12
13
+date_default_timezone_set('Europe/Prague');
14
15
+$date = DateTime::from(254400000);
16
+$dolly = $date->modifyClone();
17
+Assert::type(DateTime::class, $dolly);
18
+Assert::notSame($date, $dolly);
19
+Assert::same((string) $date, (string) $dolly);
20
21
22
+$dolly2 = $date->modifyClone('+1 hour');
23
+Assert::type(DateTime::class, $dolly2);
24
+Assert::notSame($date, $dolly2);
25
+Assert::notSame((string) $date, (string) $dolly2);
0 commit comments