Skip to content

Commit 7e505ab

Browse files
committed
tests: added test
1 parent d8eadeb commit 7e505ab

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)