Skip to content

Commit

Permalink
Test if the context array accepts closed resources
Browse files Browse the repository at this point in the history
  • Loading branch information
RGustBardon committed Dec 26, 2017
1 parent 4ebe3a8 commit d6f3561
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Psr/Log/Test/LoggerInterfaceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ public function testObjectCastToString()

public function testContextCanContainAnything()
{
$closed = fopen('php://memory', 'r');
fclose($closed);

$context = array(
'bool' => true,
'null' => null,
Expand All @@ -110,6 +113,7 @@ public function testContextCanContainAnything()
'nested' => array('with object' => new DummyTest),
'object' => new \DateTime,
'resource' => fopen('php://memory', 'r'),
'closed' => $closed,
);

$this->getLogger()->warning('Crazy context data', $context);
Expand Down

0 comments on commit d6f3561

Please sign in to comment.