From 504de00b6bbf653c5cafaf132cd78a42ba912e36 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 May 2014 02:10:09 +0200 Subject: [PATCH] #6058 - Verifying that a timestamp filter can be built from a traversable --- tests/ZendTest/Log/Filter/TimestampTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/ZendTest/Log/Filter/TimestampTest.php b/tests/ZendTest/Log/Filter/TimestampTest.php index 9cc01ee5d86..d07966075e0 100644 --- a/tests/ZendTest/Log/Filter/TimestampTest.php +++ b/tests/ZendTest/Log/Filter/TimestampTest.php @@ -9,6 +9,7 @@ namespace ZendTest\Log\Filter; +use ArrayObject; use PHPUnit_Framework_TestCase as TestCase; use Zend\Log\Filter\Timestamp as TimestampFilter; @@ -114,4 +115,18 @@ public function testFilterCreatedFromArray() $this->assertAttributeEquals($config['dateFormatChar'], 'dateFormatChar', $filter); $this->assertAttributeEquals($config['operator'], 'operator', $filter); } + + public function testFilterCreatedFromTraversable() + { + $config = new ArrayObject(array( + 'value' => 10, + 'dateFormatChar' => 'm', + 'operator' => '==', + )); + $filter = new TimestampFilter($config); + + $this->assertAttributeEquals($config['value'], 'value', $filter); + $this->assertAttributeEquals($config['dateFormatChar'], 'dateFormatChar', $filter); + $this->assertAttributeEquals($config['operator'], 'operator', $filter); + } }