Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorsimivar <simivar@gmail.com>2018-02-26 13:42:59 +0300
committerStefan Giehl <stefan@piwik.org>2018-02-26 13:42:59 +0300
commit07b654dd2c432394f9e6d135c85c59bf7a992218 (patch)
treec50477c6eb278b81aa620b1c0991f5ab12fe92f2 /tests
parent698f06b0b927f6b2b728ac65d21c3f9016edfe28 (diff)
Update error message in API/UI if date is before 1992 (#12559) (#12561)
* Update error message in API/UI if date is before 1992 (#12559) * Fix test for dates * Fix test for dates * Move creation of $dateOfFirstWebsite object to if block
Diffstat (limited to 'tests')
-rw-r--r--tests/PHPUnit/Unit/PeriodTest.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/PHPUnit/Unit/PeriodTest.php b/tests/PHPUnit/Unit/PeriodTest.php
index b3f6b06adf..76af0c719e 100644
--- a/tests/PHPUnit/Unit/PeriodTest.php
+++ b/tests/PHPUnit/Unit/PeriodTest.php
@@ -84,9 +84,25 @@ class PeriodTest extends \PHPUnit_Framework_TestCase
array('today,last7'),
array('2013-01-01,last7'),
array('today,2013-01-01'),
- array('1990-01-01'),
array('1990-01-0111'),
array('foobar'),
+ );
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage is a date before first website was online. Try date that's after
+ * @dataProvider getInvalidDatesBeforeFirstWebsite
+ */
+ public function testValidate_InvalidDatesBeforeFirstWebsite($invalidDatesBeforeFirstWebsite)
+ {
+ Period::checkDateFormat($invalidDatesBeforeFirstWebsite);
+ }
+
+ public function getInvalidDatesBeforeFirstWebsite()
+ {
+ return array(
+ array('1990-01-01'),
array(3434),
);
}