diff options
author | Stefan Giehl <stefan@matomo.org> | 2020-03-05 11:52:40 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-05 11:52:40 +0300 |
commit | 091c51fec8c16abf613a68e0f0e0015448778d2c (patch) | |
tree | 889876f243cb12577c03587efeee0d6573b27f2e /tests/PHPUnit | |
parent | 6a3fc7d70e231f5b50f1df56c3741cd4c9535fdc (diff) |
Convert range date to date archive if needed (#15665)
Diffstat (limited to 'tests/PHPUnit')
-rw-r--r-- | tests/PHPUnit/Integration/Period/FactoryTest.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/PHPUnit/Integration/Period/FactoryTest.php b/tests/PHPUnit/Integration/Period/FactoryTest.php index 470cacccd1..4168f770b4 100644 --- a/tests/PHPUnit/Integration/Period/FactoryTest.php +++ b/tests/PHPUnit/Integration/Period/FactoryTest.php @@ -83,6 +83,7 @@ class FactoryTest extends IntegrationTestCase ['range', '2015-01-01,2015-01-10', 'UTC', Range::class, '2015-01-01,2015-01-10'], ['range', '2015-01-01,2015-01-10', 'Antarctica/Casey', Range::class, '2015-01-01,2015-01-10'], + ['range', '2015-01-01,2015-01-01', 'Antarctica/Casey', Day::class, '2015-01-01,2015-01-01'], // multiple periods ['day', '2015-01-01,2015-01-10', 'UTC', Range::class, '2015-01-01,2015-01-10'], @@ -92,6 +93,13 @@ class FactoryTest extends IntegrationTestCase ]; } + public function test_makePeriodFromQueryParams() + { + $factory = Period\Factory::makePeriodFromQueryParams('UTC', 'range', '2019-01-01,2019-01-01'); + $this->assertTrue($factory instanceof Day); + $this->assertEquals('2019-01-01', $factory->toString()); + } + public function test_build_CreatesCustomPeriodInstances() { Config::getInstance()->General['enabled_periods_API'] .= ',customperiod'; |