From d6f3561053077e876202800e4813383ae693547c Mon Sep 17 00:00:00 2001 From: Robert Gust-Bardon Date: Tue, 26 Dec 2017 14:03:26 -0600 Subject: [PATCH] Test if the context array accepts closed resources --- Psr/Log/Test/LoggerInterfaceTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Psr/Log/Test/LoggerInterfaceTest.php b/Psr/Log/Test/LoggerInterfaceTest.php index a0391a5..4b861c3 100644 --- a/Psr/Log/Test/LoggerInterfaceTest.php +++ b/Psr/Log/Test/LoggerInterfaceTest.php @@ -101,6 +101,9 @@ public function testObjectCastToString() public function testContextCanContainAnything() { + $closed = fopen('php://memory', 'r'); + fclose($closed); + $context = array( 'bool' => true, 'null' => null, @@ -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);