Skip to content

Commit

Permalink
Test for "Nette DI: suspicious dumping of objects DateTimeImmutable w…
Browse files Browse the repository at this point in the history
…hen generating the container" (#308)
  • Loading branch information
kukulich committed Feb 12, 2024
1 parent 0a8172e commit 13ff265
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/DI/Compiler.parameters.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,19 @@ test('Statement within string expansion', function () {
});


test('Statement with datetime', function () {
$compiler = new DI\Compiler;
$container = createContainer($compiler, '
parameters:
datetime: 2000-01-01 00:00:00 +0000
services:
one: Service(%datetime%)
');

Assert::same('2000-01-01', $container->getService('one')->arg->format('Y-m-d'));
});

test('Statement within array expansion', function () {
$compiler = new DI\Compiler;
$container = createContainer($compiler, '
Expand Down

0 comments on commit 13ff265

Please sign in to comment.