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

Commit

Permalink
zendframework/zendframework#6058 - Moving data provider to the bottom…
Browse files Browse the repository at this point in the history
… of the test
  • Loading branch information
Ocramius committed May 3, 2014
1 parent 95d0d07 commit cfa0c12
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions test/Filter/TimestampTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,6 @@ public function testComparisonWhenValueIsSuppliedAsDateTimeObject($timestamp, $d
}
}

public function dateTimeDataProvider()
{
return array(
array(new DateTime('2014-03-03'), new DateTime('2014-03-03'), '>=', true),
array(new DateTime('2014-10-10'), new DateTime('2014-03-03'),'>=', true),
array(new DateTime('2014-03-03'), new DateTime('2014-10-10'), 'gt', false),
array(new DateTime('2013-03-03'), new DateTime('2014-03-03'), 'ge', false),
array(new DateTime('2014-03-03'), new DateTime('2014-03-03'), '==', true),
array(new DateTime('2014-02-02'), new DateTime('2014-03-03'), '<', true),
array(new DateTime('2014-03-03'), new DateTime('2014-03-03'), 'lt', false),
array(1399140540, new DateTime('2014-03-03'), 'lt', false),
array(1399140480, new DateTime('2014-03-03'), 'lt', true),
array('1399140540', new DateTime('2014-03-03'), 'lt', false),
array('1399140480', new DateTime('2014-03-03'), 'lt', true),
);
}

/**
* @dataProvider datePartDataProvider
*/
Expand Down Expand Up @@ -134,6 +117,23 @@ public function testIgnoresMessagesWithoutTimestamp(array $message)
$this->assertFalse($filter->filter($message));
}

public function dateTimeDataProvider()
{
return array(
array(new DateTime('2014-03-03'), new DateTime('2014-03-03'), '>=', true),
array(new DateTime('2014-10-10'), new DateTime('2014-03-03'),'>=', true),
array(new DateTime('2014-03-03'), new DateTime('2014-10-10'), 'gt', false),
array(new DateTime('2013-03-03'), new DateTime('2014-03-03'), 'ge', false),
array(new DateTime('2014-03-03'), new DateTime('2014-03-03'), '==', true),
array(new DateTime('2014-02-02'), new DateTime('2014-03-03'), '<', true),
array(new DateTime('2014-03-03'), new DateTime('2014-03-03'), 'lt', false),
array(1399140540, new DateTime('2014-03-03'), 'lt', false),
array(1399140480, new DateTime('2014-03-03'), 'lt', true),
array('1399140540', new DateTime('2014-03-03'), 'lt', false),
array('1399140480', new DateTime('2014-03-03'), 'lt', true),
);
}

public function datePartDataProvider()
{
return array(
Expand Down

0 comments on commit cfa0c12

Please sign in to comment.