-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added method setIntervalForQueryingUsingExclusiveTimes and unit tests.
- Loading branch information
1 parent
ff301c0
commit 32b5f78
Showing
2 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
tests/DruidFamiliar/Test/QueryParameters/SimpleGroupByQueryParametersTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace DruidFamiliar\Test\QueryParameters; | ||
|
||
use DruidFamiliar\Interval; | ||
use PHPUnit_Framework_TestCase; | ||
|
||
class SimpleGroupByQueryParametersTest extends PHPUnit_Framework_TestCase | ||
{ | ||
|
||
public function testAdjustTimeIntervalForQueryingSuccessfullyBuildsExclusiveTimes() | ||
{ | ||
$query = $this->getMockBuilder('DruidFamiliar\QueryParameters\SimpleGroupByQueryParameters') | ||
->setMethods(null) | ||
->getMock(); | ||
|
||
$origStartDateTime = '2014-06-18T12:30:01Z'; | ||
$origEndDateTime = '2014-06-18T01:00:00Z'; | ||
|
||
$expectedResults = new Interval('2014-06-18T12:30:00Z', '2014-06-18T01:00:01Z'); | ||
|
||
$query->setIntervalForQueryingUsingExclusiveTimes($origStartDateTime, $origEndDateTime); | ||
$results = $query->getIntervals(); | ||
$this->assertEquals($expectedResults, $results); | ||
} | ||
|
||
} |