Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
#6058 - Verifying that a timestamp filter can be built from a travers…
Browse files Browse the repository at this point in the history
…able
  • Loading branch information
Ocramius committed May 3, 2014
1 parent dfe05b0 commit 504de00
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/ZendTest/Log/Filter/TimestampTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace ZendTest\Log\Filter;

use ArrayObject;
use PHPUnit_Framework_TestCase as TestCase;
use Zend\Log\Filter\Timestamp as TimestampFilter;

Expand Down Expand Up @@ -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);
}
}

0 comments on commit 504de00

Please sign in to comment.